dotfiles
1

Configure Feed

Select the types of activity you want to include in your feed.

Add new power menu to the bottom right

Juan Nunez-Iglesias (Jun 29, 2026, 12:17 AM +0200) f70a11a1 38acfbb3

+62 -3
+9 -1
sway/config
··· 232 232 # Manual lock 233 233 bindsym Control+Mod4+l exec $lock 234 234 235 + # Power menu (Lock/Logout/Suspend/Hibernate/Reboot/Shutdown). 236 + # A compact wofi list pinned to the bottom-right, also reachable from the ⏻ 237 + # button on the Waybar tray end. Its Lock entry runs `loginctl lock-session`, 238 + # which the swayidle `lock` handler below turns into our themed $lock. 239 + bindsym $mod+Escape exec ~/.config/sway/power-menu.sh 240 + 235 241 # Auto-lock + display power management. 236 242 # - lock after 5 min idle 237 243 # - blank the outputs after 10 min (and restore on activity) 238 244 # - always lock right before the system suspends, so it's locked on resume 245 + # - `lock` fires on `loginctl lock-session` (e.g. from wlogout) -> themed $lock 239 246 exec swayidle -w \ 240 247 timeout 300 '$lock' \ 241 248 timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ 242 - before-sleep '$lock' 249 + before-sleep '$lock' \ 250 + lock '$lock' 243 251 244 252 # resize window (you can also use the mouse for that) 245 253 mode "resize" {
+31
sway/power-menu.sh
··· 1 + #!/usr/bin/env sh 2 + # Compact power menu via wofi, anchored to the bottom-right next to the Waybar 3 + # ⏻ button. Entries are ordered so the most-used actions (Logout/Lock) sit at 4 + # the BOTTOM of the list, closest to the button you just clicked. 5 + # 6 + # Invoked by $mod+Escape (sway/config) and the custom/power Waybar module 7 + # (waybar/config). Lock goes through `loginctl lock-session`, which swayidle's 8 + # `lock` handler turns into the themed $lock (see sway/config). 9 + # 10 + # --cache-file /dev/null keeps wofi from reordering entries by usage frequency, 11 + # so the deliberate ordering below is preserved. 12 + 13 + chosen=$(printf '%s\n' \ 14 + Shutdown \ 15 + Reboot \ 16 + Hibernate \ 17 + Suspend \ 18 + Logout \ 19 + Lock \ 20 + | wofi --dmenu --prompt Power \ 21 + --location bottom_right --width 200 --lines 7 \ 22 + --cache-file /dev/null) 23 + 24 + case "$chosen" in 25 + Lock) loginctl lock-session ;; 26 + Logout) swaymsg exit ;; 27 + Suspend) systemctl suspend ;; 28 + Hibernate) systemctl hibernate ;; 29 + Reboot) systemctl reboot ;; 30 + Shutdown) systemctl poweroff ;; 31 + esac
+11 -1
waybar/config
··· 21 21 "clock#dc", 22 22 "clock#madrid", 23 23 "clock#melbourne", 24 - "tray" 24 + "tray", 25 + "custom/power" 25 26 ], 26 27 27 28 "sway/workspaces": { ··· 100 101 "tray": { 101 102 "icon-size": 18, 102 103 "spacing": 8 104 + }, 105 + 106 + // Power button -> compact wofi power menu pinned bottom-right (the script 107 + // sets Lock/Logout/Suspend/...). Same menu is bound to $mod+Escape in 108 + // sway/config. 109 + "custom/power": { 110 + "format": "⏻", 111 + "tooltip": false, 112 + "on-click": "~/.config/sway/power-menu.sh" 103 113 } 104 114 }
+11 -1
waybar/style.css
··· 40 40 #pulseaudio, 41 41 #battery, 42 42 #clock, 43 - #tray { 43 + #tray, 44 + #custom-power { 44 45 padding: 0 10px; 46 + } 47 + 48 + #custom-power { 49 + color: #bf616a; 50 + padding-right: 14px; 51 + } 52 + 53 + #custom-power:hover { 54 + color: #e0def4; 45 55 } 46 56 47 57 #battery.warning {