diff --git a/.local/scripts/powermenu.fish b/.local/scripts/powermenu.fish index feb8bb1..a684978 100755 --- a/.local/scripts/powermenu.fish +++ b/.local/scripts/powermenu.fish @@ -1,28 +1,22 @@ #!/usr/bin/env fish set input_options "󰌾 Lock" "󰤄 Suspend" "󰐥 Poweroff" "󰜉 Reboot" -set input (menu $input_options) +set input (menu $input_options || exit) -set check_options "Cancel" "Proceed" +if test (menu "Cancel" "Proceed") = Proceed + switch $input + case $input_options[1] + swaylock -f -set check (menu $check_options) - -if test $check = $check_options[1] - exit 0 -end - -switch $input - case $input_options[1] - swaylock -f - - case $input_options[2] - swaylock -f - systemctl suspend - - case $input_options[3] - systemctl poweroff - - case $input_options[4] - systemctl reboot + case $input_options[2] + swaylock -f + systemctl suspend + case $input_options[3] + systemctl poweroff + + case $input_options[4] + systemctl reboot + + end end