From 7166dad8f8439bbe90c7dc0b1b48010bd87153f1 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:37 +0100 Subject: 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. --- dot_config/sway/config | 6 +----- dot_config/sway/executable_power-menu.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 dot_config/sway/executable_power-menu.sh 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 -- cgit v1.3.1