mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-02 12:47:49 +02:00
43 lines
660 B
Bash
Executable File
43 lines
660 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Toggle Omarchy features between enabled and disabled
|
|
# omarchy:args=<flag-name> [toggle|on|off]
|
|
|
|
if (($# < 1)); then
|
|
echo "Usage: omarchy-toggle <flag-name> [toggle|on|off]" >&2
|
|
exit 1
|
|
fi
|
|
|
|
FLAG_NAME="$1"
|
|
ACTION="${2:-toggle}"
|
|
FLAG="$HOME/.local/state/omarchy/toggles/$FLAG_NAME"
|
|
|
|
enable() {
|
|
mkdir -p "$(dirname "$FLAG")"
|
|
touch "$FLAG"
|
|
}
|
|
|
|
disable() {
|
|
rm -f "$FLAG"
|
|
}
|
|
|
|
case "$ACTION" in
|
|
toggle|"")
|
|
if [[ -f $FLAG ]]; then
|
|
disable
|
|
else
|
|
enable
|
|
fi
|
|
;;
|
|
on)
|
|
enable
|
|
;;
|
|
off)
|
|
disable
|
|
;;
|
|
*)
|
|
echo "Usage: omarchy-toggle <flag-name> [toggle|on|off]" >&2
|
|
exit 1
|
|
;;
|
|
esac
|