dotfiles/.local/scripts/powermenu.fish

26 lines
415 B
Fish
Raw Normal View History

2025-12-29 23:40:17 +01:00
#!/usr/bin/env fish
2025-12-30 22:04:10 +01:00
set input_options "󰤄 Suspend" "󰐥 Poweroff" "󰜉 Reboot"
2025-12-29 23:40:17 +01:00
2025-12-30 22:04:10 +01:00
set input (menu $input_options)
2025-12-29 23:40:17 +01:00
2025-12-30 22:04:10 +01:00
set check_options "Cancel" "Proceed"
2025-12-29 23:40:17 +01:00
2025-12-30 22:04:10 +01:00
set check (menu $check_options)
if test $check = $check_options[1]
2025-12-29 23:40:17 +01:00
exit 0
end
2025-12-30 22:04:10 +01:00
switch $input
case $input_options[1]
swaylock -f
2025-12-30 18:11:42 +01:00
systemctl suspend
2025-12-29 23:40:17 +01:00
2025-12-30 22:04:10 +01:00
case $input_options[2]
2025-12-30 18:11:42 +01:00
systemctl poweroff
2025-12-30 22:04:10 +01:00
case $input_options[2]
2025-12-30 18:11:42 +01:00
systemctl reboot
2025-12-29 23:40:17 +01:00
end