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/sway/executable_power-menu.sh | |
| 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/sway/executable_power-menu.sh')
| -rw-r--r-- | dot_config/sway/executable_power-menu.sh | 19 |
1 files changed, 19 insertions, 0 deletions
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 |
