dotfiles/.local/scripts/powermenu.fish

29 lines
466 B
Fish
Raw Normal View History

2025-12-29 23:40:17 +01:00
#!/usr/bin/env fish
2026-01-25 15:44:54 +01:00
set input_options "󰌾 Lock" "󰤄 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
2026-01-25 15:44:54 +01:00
case $input_options[1]
2025-12-30 22:04:10 +01:00
swaylock -f
2025-12-29 23:40:17 +01:00
2025-12-30 22:04:10 +01:00
case $input_options[2]
2026-01-25 15:44:54 +01:00
swaylock -f
systemctl suspend
case $input_options[3]
2025-12-30 18:11:42 +01:00
systemctl poweroff
2026-01-25 15:44:54 +01:00
case $input_options[4]
2025-12-30 18:11:42 +01:00
systemctl reboot
2025-12-29 23:40:17 +01:00
end