dotfiles/.local/scripts/powermenu.fish
2025-12-30 18:11:42 +01:00

23 lines
396 B
Fish
Executable file

#!/usr/bin/env fish
set input (echo -e '󰤄 Suspend\n󰐥 Poweroff\n󰜉 Reboot' | fuzzel --dmenu -l 3 || exit 0)
set check (echo -e 'Cancel\nProceed' | fuzzel --dmenu -l 2 || exit 0)
if test $check = "Cancel"
exit 0
end
set option (string sub --start=3 $input)
switch $option
case Suspend
systemctl suspend
case Poweroff
systemctl poweroff
case Reboot
systemctl reboot
end