diff options
Diffstat (limited to '.local/bin')
-rwxr-xr-x | .local/bin/power-menu | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/.local/bin/power-menu b/.local/bin/power-menu new file mode 100755 index 0000000..203e8cf --- /dev/null +++ b/.local/bin/power-menu @@ -0,0 +1,27 @@ +#!/bin/bash + +selection=$(cat <<EOF | fzf --no-sort +Exit +Logout +Screenoff +Halt +Suspend +Hibernate +Reboot-EFI +Reboot +Shutdown +EOF +); + +case "$selection" in + Shutdown) systemctl poweroff ;; + Reboot) systemctl reboot ;; + Reboot-EFI) systemctl reboot --firmware-setup ;; + Hibernate) systemctl hibernate ;; + Suspend) systemctl suspend ;; + Halt) systemctl halt ;; + Screenoff) sleep 0.5s && pkill -USR1 swayidle ;; + Logout) pkill -KILL -u "$(whoami)" ;; + Exit) swaymsg exit ;; + *) exit 1 +esac |