diff options
| author | 2026-05-13 13:43:37 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:37 +0100 | |
| commit | 7166dad8f8439bbe90c7dc0b1b48010bd87153f1 (patch) | |
| tree | cbcc211472ed5c003e1098a167fdac16f56e1409 /dot_config | |
| parent | 03164e770e040b54fc69e355c6c977e8ffb013eb (diff) | |
| download | dotfiles-7166dad8f8439bbe90c7dc0b1b48010bd87153f1.tar.gz dotfiles-7166dad8f8439bbe90c7dc0b1b48010bd87153f1.tar.bz2 dotfiles-7166dad8f8439bbe90c7dc0b1b48010bd87153f1.zip | |
feat(sway): keyboard-driven fuzzel power menu, replace swaynag
swaynag buttons require a mouse click. Replace the Mod+Shift+e session
prompt with a fuzzel --dmenu picker so the whole menu is keyboard
navigable. Adds Suspend as a new entry while we're here.
Diffstat (limited to 'dot_config')
| -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 |
