diff options
| author | 2026-05-13 13:43:11 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:11 +0100 | |
| commit | e1bea3564e395c0dd7f046ca30327977065a5eb9 (patch) | |
| tree | e8d16cdc8a45e200055c3fd409edb3c823be4e23 /dot_config | |
| parent | 867070246609a3ec05a42cccde8cbf91897fde52 (diff) | |
| download | dotfiles-e1bea3564e395c0dd7f046ca30327977065a5eb9.tar.gz dotfiles-e1bea3564e395c0dd7f046ca30327977065a5eb9.tar.bz2 dotfiles-e1bea3564e395c0dd7f046ca30327977065a5eb9.zip | |
feat(sway): auto-lock on idle and before suspend
- logind: IdleAction=lock, IdleActionSec=5min. systemd emits a lock
signal at 5min idle (session becomes locked from logind PoV; swayidle
listens and invokes swaylock).
- swayidle: lock at 5min, blank display at 6min, lock before sleep.
Closes the gap where lid-close or manual suspend would wake to an
unlocked session.
- swaylock: add -i (--ignore-empty-password) to ignore accidental Enter.
- meta/wayland: add swayidle.
Diffstat (limited to 'dot_config')
| -rw-r--r-- | dot_config/sway/config | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/dot_config/sway/config b/dot_config/sway/config index 119849d..d780023 100644 --- a/dot_config/sway/config +++ b/dot_config/sway/config @@ -136,7 +136,7 @@ bindsym Print exec grim -g "$(slurp)" ~/pics/screenshots/$(date +%Y-%m-%d-%H-%M- bindsym Shift+Print exec grim ~/pics/screenshots/$(date +%Y-%m-%d-%H-%M-%S).png # Lock & pause -bindsym $mod+Shift+s exec "playerctl -a pause; swaylock -f -c 282828" +bindsym $mod+Shift+s exec "playerctl -a pause; swaylock -f -i -c 282828" # Notifications bindsym $mod+n exec makoctl dismiss @@ -155,3 +155,10 @@ exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CU exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP exec "sleep 2 && ~/.config/sway/display-toggle.sh init" exec systemctl --user start sway-session.target + +# Idle: lock at 5min (matches IdleActionSec), blank at 6min, lock before sleep. +exec swayidle -w \ + timeout 300 'swaylock -f -i -c 282828' \ + timeout 360 'swaymsg "output * power off"' \ + resume 'swaymsg "output * power on"' \ + before-sleep 'playerctl -a pause; swaylock -f -i -c 282828' |
