commit c478870c7c2315442e6b58d4b657cba6301a919f
parent 0b1949f80badd74651cffffbcdff04682cc1ae99
Author: Chris Bracken <chris@bracken.jp>
Date: Wed, 8 Sep 2021 21:35:04 -0700
sway: fix suspend on lock
First, ensure that swaylock runs in daemon mode, similar to the default
behaviour of i3lock; without this, later commands like disabling
monitors or suspending won't run until swaylock returns, on unlock.
Second, trigger systemctl suspend rather than just disabling/re-enabling
the monitors after a timeout.
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/.config/sway/config b/.config/sway/config
@@ -41,7 +41,7 @@ set $term alacritty
set $menu wofi --show run
# Set lock screen handler.
-set $lock_screen swaylock -c 000000
+set $lock_screen swaylock -f -c 000000
# Set the suspend command.
set $suspend_system systemctl suspend
@@ -56,9 +56,7 @@ set $suspend_system systemctl suspend
# the computer goes to sleep.
exec swayidle -w \
timeout 600 '$lock_screen' \
- timeout 660 'swaymsg "output * dpms off"' \
- timeout 720 '$suspend_system' \
- resume 'swaymsg "output * dpms on"' \
+ timeout 660 '$suspend_system' \
before-sleep '$lock_screen'