nix-config/misc/power-menu.sh

12 lines
318 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 --dmenu --index --lines $lines --placeholder "Power action: " -I)
if [ -n "$a" ]; then
${cmds[a]}
fi