Move flags to persistent setup so hyprctl reload doesn't reset them

This commit is contained in:
David Heinemeier Hansson committed 2026-04-17 14:16:47 +02:00
1 parent 8912bcb81c
commit 79d3b8cec6
12 files changed
+78 -30

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
# Toggle permanent Hyprland flags by copying them into a directory that's sourced entirely.
ENABLED_NOTIFICATION=""
DISABLED_NOTIFICATION=""
while [[ $# -gt 1 ]]; do
case $1 in
--enabled-notification) ENABLED_NOTIFICATION="$2"; shift 2 ;;
--disabled-notification) DISABLED_NOTIFICATION="$2"; shift 2 ;;
*) break ;;
esac
done
FLAG_NAME="$1"
flag="$HOME/.local/state/omarchy/flags/hypr/$FLAG_NAME.conf"
flag_source="$OMARCHY_PATH/default/hypr/flags/$FLAG_NAME.conf"
if [[ -f $flag ]]; then
rm $flag
[[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION"
elif [[ -f $flag_source ]]; then
cp $flag_source $flag
[[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION"
else
echo "Flag not found"
exit 1
fi
hyprctl reload