nix-config/misc/power-menu.sh
2026-01-19 19:04:05 +01:00

12 lines
336 B
Bash
Executable file

cmds=('shutdown now' 'reboot' 'hyprlock' 'hyprctl dispatch exit')
count=${#cmds[@]}
default=15
lines=$((count > default ? default : count))
a=$(printf ' Shut down\n Reboot\n Lock\n Log out' | fuzzel --cache /dev/null --dmenu --index --lines $lines --placeholder "Power action: " -I)
if [ -n "$a" ]; then
${cmds[a]}
fi