Use preexisting toggles setup
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Check if a Hyprland flag is currently disabled (missing).
|
|
||||||
|
|
||||||
[[ ! -f "$HOME/.local/state/omarchy/flags/hypr/$1.conf" ]]
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Check if a Hyprland flag is currently enabled.
|
|
||||||
|
|
||||||
[[ -f "$HOME/.local/state/omarchy/flags/hypr/$1.conf" ]]
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/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')
|
ACTIVE_COUNT=$(hyprctl monitors -j | jq 'length')
|
||||||
if [[ $ACTIVE_COUNT -le 1 ]]; then
|
if [[ $ACTIVE_COUNT -le 1 ]]; then
|
||||||
notify-send -u low " Can't disable the only active display"
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
omarchy-hyprland-flag-toggle \
|
omarchy-hyprland-toggle \
|
||||||
--enabled-notification " Internal display off" \
|
--enabled-notification " Internal display off" \
|
||||||
--disabled-notification " Internal display on" \
|
--disabled-notification " Internal display on" \
|
||||||
internal-monitor-disable
|
internal-monitor-disable
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ while [[ $# -gt 1 ]]; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
FLAG_NAME="$1"
|
FLAG_NAME="$1"
|
||||||
flag="$HOME/.local/state/omarchy/flags/hypr/$FLAG_NAME.conf"
|
FLAG="$HOME/.local/state/omarchy/toggles/hypr/$FLAG_NAME.conf"
|
||||||
flag_source="$OMARCHY_PATH/default/hypr/flags/$FLAG_NAME.conf"
|
FLAG_SOURCE="$OMARCHY_PATH/default/hypr/toggles/$FLAG_NAME.conf"
|
||||||
|
|
||||||
if [[ -f $flag ]]; then
|
if [[ -f $FLAG ]]; then
|
||||||
rm $flag
|
rm $FLAG
|
||||||
[[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION"
|
[[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION"
|
||||||
elif [[ -f $flag_source ]]; then
|
elif [[ -f $FLAG_SOURCE ]]; then
|
||||||
cp $flag_source $flag
|
cp $FLAG_SOURCE $FLAG
|
||||||
[[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION"
|
[[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION"
|
||||||
else
|
else
|
||||||
echo "Flag not found"
|
echo "Flag not found"
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check if a Hyprland toggle is currently disabled (missing).
|
||||||
|
|
||||||
|
[[ ! -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check if a Hyprland toggle is currently enabled.
|
||||||
|
|
||||||
|
[[ -f "$HOME/.local/state/omarchy/toggles/hypr/$1.conf" ]]
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
# Toggles the window gaps globally between no gaps and the default.
|
# 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
|
#!/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" \
|
--enabled-notification " Enable single-window square aspect ratio" \
|
||||||
--disabled-notification " Disable single-window square aspect ratio" \
|
--disabled-notification " Disable single-window square aspect ratio" \
|
||||||
single-window-aspect-ratio
|
single-window-aspect-ratio
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ source = ~/.config/hypr/looknfeel.conf
|
|||||||
source = ~/.config/hypr/autostart.conf
|
source = ~/.config/hypr/autostart.conf
|
||||||
|
|
||||||
# Toggle config flags dynamically
|
# 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
|
# Add any other personal Hyprland configuration below
|
||||||
# windowrule = workspace 5, match:class qemu
|
# windowrule = workspace 5, match:class qemu
|
||||||
|
|||||||
@@ -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/sudoless-asdcontrol.sh
|
||||||
run_logged $OMARCHY_INSTALL/config/input-group.sh
|
run_logged $OMARCHY_INSTALL/config/input-group.sh
|
||||||
run_logged $OMARCHY_INSTALL/config/omarchy-ai-skill.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/kernel-modules-hook.sh
|
||||||
run_logged $OMARCHY_INSTALL/config/powerprofilesctl-rules.sh
|
run_logged $OMARCHY_INSTALL/config/powerprofilesctl-rules.sh
|
||||||
run_logged $OMARCHY_INSTALL/config/wifi-powersave-rules.sh
|
run_logged $OMARCHY_INSTALL/config/wifi-powersave-rules.sh
|
||||||
|
|||||||
@@ -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/
|
|
||||||
@@ -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/
|
||||||
@@ -2,8 +2,8 @@ echo "Add flags sourcing to hyprland.conf"
|
|||||||
|
|
||||||
HYPR_CONF=~/.config/hypr/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
|
if [[ -f $HYPR_CONF ]] && ! grep -q "toggles/hypr/\*\.conf" "$HYPR_CONF"; then
|
||||||
echo -e "\n# Toggle config flags dynamically\nsource = ~/.local/state/omarchy/flags/hypr/*.conf" >> "$HYPR_CONF"
|
echo -e "\n# Toggle config flags dynamically\nsource = ~/.local/state/omarchy/toggles/hypr/*.conf" >> "$HYPR_CONF"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user