mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
* Add omarchy CLI * Remove outdated or internal * Add bash completions for command * Add omarchy command documentation * Add missing docs * Correct to what's now right * Fix tests --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
28 lines
744 B
Bash
Executable File
28 lines
744 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Toggle Omarchy features between enabled and disabled
|
|
# omarchy:args=[--enabled-notification <text>] [--disabled-notification <text>] <flag-name>
|
|
|
|
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/toggles/$FLAG_NAME"
|
|
|
|
if [[ -f $FLAG ]]; then
|
|
rm $FLAG
|
|
[[ -n $DISABLED_NOTIFICATION ]] && notify-send -u low "$DISABLED_NOTIFICATION"
|
|
else
|
|
mkdir -p "$(dirname $FLAG)"
|
|
touch $FLAG
|
|
[[ -n $ENABLED_NOTIFICATION ]] && notify-send -u low "$ENABLED_NOTIFICATION"
|
|
fi
|