Use preexisting toggles setup

This commit is contained in:
David Heinemeier Hansson
2026-04-17 16:03:06 +02:00
parent adb8d01d57
commit e852895e5c
17 changed files with 30 additions and 30 deletions
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
# Check if a Hyprland flag is currently disabled (missing).
[[ ! -f "$HOME/.local/state/omarchy/flags/hypr/$1.conf" ]]
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
# Check if a Hyprland flag is currently enabled.
[[ -f "$HOME/.local/state/omarchy/flags/hypr/$1.conf" ]]
+3 -3
View File
@@ -1,8 +1,8 @@
#!/bin/bash
# Toggle the internal laptop display on/off using the flag system.
# Toggle the internal laptop display on/off.
if omarchy-hyprland-flag-missing internal-monitor-disable; then
if omarchy-hyprland-toggle-disabled internal-monitor-disable; then
ACTIVE_COUNT=$(hyprctl monitors -j | jq 'length')
if [[ $ACTIVE_COUNT -le 1 ]]; then
notify-send -u low "󰍹 Can't disable the only active display"
@@ -10,7 +10,7 @@ if omarchy-hyprland-flag-missing internal-monitor-disable; then
fi
fi
omarchy-hyprland-flag-toggle \
omarchy-hyprland-toggle \
--enabled-notification "󰍹 Internal display off" \
--disabled-notification "󰍹 Internal display on" \
internal-monitor-disable
@@ -14,14 +14,14 @@ while [[ $# -gt 1 ]]; do
done
FLAG_NAME="$1"
flag="$HOME/.local/state/omarchy/flags/hypr/$FLAG_NAME.conf"
flag_source="$OMARCHY_PATH/default/hypr/flags/$FLAG_NAME.conf"
FLAG="$HOME/.local/state/omarchy/toggles/hypr/$FLAG_NAME.conf"
FLAG_SOURCE="$OMARCHY_PATH/default/hypr/toggles/$FLAG_NAME.conf"
if [[ -f $flag ]]; then
rm $flag
if [[ -f $FLAG ]]; then
rm $FLAG
[[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION"
elif [[ -f $flag_source ]]; then
cp $flag_source $flag
elif [[ -f $FLAG_SOURCE ]]; then
cp $FLAG_SOURCE $FLAG
[[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION"
else
echo "Flag not found"
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
# Check if a Hyprland toggle is currently disabled (missing).
[[ ! -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
# Check if a Hyprland toggle is currently enabled.
[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
+1 -1
View File
@@ -2,4 +2,4 @@
# Toggles the window gaps globally between no gaps and the default.
omarchy-hyprland-flag-toggle window-no-gaps
omarchy-hyprland-toggle window-no-gaps
@@ -1,8 +1,8 @@
#!/bin/bash
# Toggle single-window square aspect ratio using the flag system.
# Toggle single-window square aspect ratio.
omarchy-hyprland-flag-toggle \
omarchy-hyprland-toggle \
--enabled-notification " Enable single-window square aspect ratio" \
--disabled-notification " Disable single-window square aspect ratio" \
single-window-aspect-ratio
+1 -1
View File
@@ -20,7 +20,7 @@ source = ~/.config/hypr/looknfeel.conf
source = ~/.config/hypr/autostart.conf
# Toggle config flags dynamically
source = ~/.local/state/omarchy/flags/hypr/*.conf
source = ~/.local/state/omarchy/toggles/hypr/*.conf
# Add any other personal Hyprland configuration below
# windowrule = workspace 5, match:class qemu
+1 -1
View File
@@ -22,7 +22,7 @@ run_logged $OMARCHY_INSTALL/config/unmount-fuse.sh
run_logged $OMARCHY_INSTALL/config/sudoless-asdcontrol.sh
run_logged $OMARCHY_INSTALL/config/input-group.sh
run_logged $OMARCHY_INSTALL/config/omarchy-ai-skill.sh
run_logged $OMARCHY_INSTALL/config/omarchy-config-flags.sh
run_logged $OMARCHY_INSTALL/config/omarchy-toggles.sh
run_logged $OMARCHY_INSTALL/config/kernel-modules-hook.sh
run_logged $OMARCHY_INSTALL/config/powerprofilesctl-rules.sh
run_logged $OMARCHY_INSTALL/config/wifi-powersave-rules.sh
-3
View File
@@ -1,3 +0,0 @@
# Flags are used to toggle certain features on/off in a persistent way
mkdir -p ~/.local/state/omarchy/flags/hypr
cp $OMARCHY_PATH/default/hypr/flags/flags.conf ~/.local/state/omarchy/flags/hypr/
+3
View File
@@ -0,0 +1,3 @@
# Toggles are used to turn certain features on/off in a persistent way
mkdir -p ~/.local/state/omarchy/toggles/hypr
cp $OMARCHY_PATH/default/hypr/toggles/flags.conf ~/.local/state/omarchy/toggles/hypr/
+3 -3
View File
@@ -2,8 +2,8 @@ echo "Add flags sourcing to hyprland.conf"
HYPR_CONF=~/.config/hypr/hyprland.conf
source $OMARCHY_PATH/install/config/omarchy-config-flags.sh
source $OMARCHY_PATH/install/config/omarchy-toggles.sh
if [[ -f $HYPR_CONF ]] && ! grep -q "flags/hypr/\*\.conf" "$HYPR_CONF"; then
echo -e "\n# Toggle config flags dynamically\nsource = ~/.local/state/omarchy/flags/hypr/*.conf" >> "$HYPR_CONF"
if [[ -f $HYPR_CONF ]] && ! grep -q "toggles/hypr/\*\.conf" "$HYPR_CONF"; then
echo -e "\n# Toggle config flags dynamically\nsource = ~/.local/state/omarchy/toggles/hypr/*.conf" >> "$HYPR_CONF"
fi