diff options
| -rw-r--r-- | dot_config/sway/config | 6 | ||||
| -rw-r--r-- | dot_config/sway/executable_power-menu.sh | 19 |
2 files changed, 20 insertions, 5 deletions
diff --git a/dot_config/sway/config b/dot_config/sway/config index 4d3566d..6f8dbfc 100644 --- a/dot_config/sway/config +++ b/dot_config/sway/config @@ -123,11 +123,7 @@ bindsym $mod+r mode "resize" # Reload / session bindsym $mod+Shift+c reload -bindsym $mod+Shift+e exec swaynag -t warning -m 'Session' \ - -B 'Lock' 'playerctl -a pause; swaylock -f -e -c 000000' \ - -B 'Logout' 'swaymsg exit' \ - -B 'Reboot' 'sudo /usr/bin/reboot' \ - -B 'Poweroff' 'sudo /usr/bin/poweroff' +bindsym $mod+Shift+e exec ~/.config/sway/power-menu.sh # ── Personal keybinds ───────────────────────────────────────────────────────── diff --git a/dot_config/sway/executable_power-menu.sh b/dot_config/sway/executable_power-menu.sh new file mode 100644 index 0000000..4aebcf6 --- /dev/null +++ b/dot_config/sway/executable_power-menu.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Keyboard-driven power menu via fuzzel --dmenu. +set -eu + +choice=$(printf '%s\n' \ + " Lock" \ + " Suspend" \ + " Logout" \ + " Reboot" \ + " Poweroff" \ + | fuzzel --dmenu --prompt='power: ' --lines=5 --width=20) + +case "$choice" in + *Lock) playerctl -a pause; exec swaylock -f -e -c 000000 ;; + *Suspend) playerctl -a pause; exec systemctl suspend ;; + *Logout) exec swaymsg exit ;; + *Reboot) exec sudo /usr/bin/reboot ;; + *Poweroff) exec sudo /usr/bin/poweroff ;; +esac |
