diff --git a/bin/omarchy-hyprland-flag-missing b/bin/omarchy-hyprland-flag-missing deleted file mode 100755 index e99c6a66..00000000 --- a/bin/omarchy-hyprland-flag-missing +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Check if a Hyprland flag is currently disabled (missing). - -[[ ! -f "$HOME/.local/state/omarchy/flags/hypr/$1.conf" ]] diff --git a/bin/omarchy-hyprland-flag-present b/bin/omarchy-hyprland-flag-present deleted file mode 100755 index ea66c717..00000000 --- a/bin/omarchy-hyprland-flag-present +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Check if a Hyprland flag is currently enabled. - -[[ -f "$HOME/.local/state/omarchy/flags/hypr/$1.conf" ]] diff --git a/bin/omarchy-hyprland-monitor-internal-toggle b/bin/omarchy-hyprland-monitor-internal-toggle index 3296adb4..6cacea09 100755 --- a/bin/omarchy-hyprland-monitor-internal-toggle +++ b/bin/omarchy-hyprland-monitor-internal-toggle @@ -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 diff --git a/bin/omarchy-hyprland-flag-toggle b/bin/omarchy-hyprland-toggle similarity index 72% rename from bin/omarchy-hyprland-flag-toggle rename to bin/omarchy-hyprland-toggle index 6900bdf7..deda1cb3 100755 --- a/bin/omarchy-hyprland-flag-toggle +++ b/bin/omarchy-hyprland-toggle @@ -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" diff --git a/bin/omarchy-hyprland-toggle-disabled b/bin/omarchy-hyprland-toggle-disabled new file mode 100755 index 00000000..4e526d09 --- /dev/null +++ b/bin/omarchy-hyprland-toggle-disabled @@ -0,0 +1,5 @@ +#!/bin/bash + +# Check if a Hyprland toggle is currently disabled (missing). + +[[ ! -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]] diff --git a/bin/omarchy-hyprland-toggle-enabled b/bin/omarchy-hyprland-toggle-enabled new file mode 100755 index 00000000..59a273a4 --- /dev/null +++ b/bin/omarchy-hyprland-toggle-enabled @@ -0,0 +1,5 @@ +#!/bin/bash + +# Check if a Hyprland toggle is currently enabled. + +[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]] diff --git a/bin/omarchy-hyprland-window-gaps-toggle b/bin/omarchy-hyprland-window-gaps-toggle index 7b93530c..082e4574 100755 --- a/bin/omarchy-hyprland-window-gaps-toggle +++ b/bin/omarchy-hyprland-window-gaps-toggle @@ -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 diff --git a/bin/omarchy-hyprland-window-single-square-aspect-toggle b/bin/omarchy-hyprland-window-single-square-aspect-toggle index b933643b..70615793 100755 --- a/bin/omarchy-hyprland-window-single-square-aspect-toggle +++ b/bin/omarchy-hyprland-window-single-square-aspect-toggle @@ -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 diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 6866a136..ff272f9a 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -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 diff --git a/default/hypr/flags/flags.conf b/default/hypr/toggles/flags.conf similarity index 100% rename from default/hypr/flags/flags.conf rename to default/hypr/toggles/flags.conf diff --git a/default/hypr/flags/internal-monitor-disable.conf b/default/hypr/toggles/internal-monitor-disable.conf similarity index 100% rename from default/hypr/flags/internal-monitor-disable.conf rename to default/hypr/toggles/internal-monitor-disable.conf diff --git a/default/hypr/flags/single-window-aspect-ratio.conf b/default/hypr/toggles/single-window-aspect-ratio.conf similarity index 100% rename from default/hypr/flags/single-window-aspect-ratio.conf rename to default/hypr/toggles/single-window-aspect-ratio.conf diff --git a/default/hypr/flags/window-no-gaps.conf b/default/hypr/toggles/window-no-gaps.conf similarity index 100% rename from default/hypr/flags/window-no-gaps.conf rename to default/hypr/toggles/window-no-gaps.conf diff --git a/install/config/all.sh b/install/config/all.sh index 5ec74701..3a9eaabb 100644 --- a/install/config/all.sh +++ b/install/config/all.sh @@ -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 diff --git a/install/config/omarchy-config-flags.sh b/install/config/omarchy-config-flags.sh deleted file mode 100644 index c5a46909..00000000 --- a/install/config/omarchy-config-flags.sh +++ /dev/null @@ -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/ diff --git a/install/config/omarchy-toggles.sh b/install/config/omarchy-toggles.sh new file mode 100644 index 00000000..b4b5ea93 --- /dev/null +++ b/install/config/omarchy-toggles.sh @@ -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/ diff --git a/migrations/1776410469.sh b/migrations/1776410469.sh index a0e4d962..24aab0d6 100644 --- a/migrations/1776410469.sh +++ b/migrations/1776410469.sh @@ -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