random-scripts/system-menu/system-sleep-menu.sh

21 lines
314 B
Bash
Executable File

#!/usr/bin/env zsh
pgrep swayidle && swayidle_state="Enabled" || swayidle_state="Disabled"
choice="$(fuzzel --index -d -p "Cur: ${swayidle_state} > " <<'EOF'
Enable
Disable
EOF
)"
(( ${?} != 0 )) && exit
case "${choice}" in
0)
swayidle -w &
;;
1)
pkill swayidle
;;
esac