diff --git a/conf/sway/config b/conf/sway/config index e2c181ad..6f49a2f5 100644 --- a/conf/sway/config +++ b/conf/sway/config @@ -22,8 +22,8 @@ set $menu bemenu-run | xargs swaymsg exec -- # Screen lock command # -c, colour, -F showing failed attempts, -k keyboard layout display, -# -l, caps lock idnicator -set $ScreenLockCmd swaylock -c 000000 -F -k -l +# -l, caps lock idnicator, -f fork (required by swayidle) +set $ScreenLockCmd swaylock -c 000000 -F -k -l -f # Preferred graphical text editor set $TEXTEDITOR pluma diff --git a/conf/sway/config.d/swayidle.conf b/conf/sway/config.d/swayidle.conf new file mode 100644 index 00000000..e56124bd --- /dev/null +++ b/conf/sway/config.d/swayidle.conf @@ -0,0 +1,11 @@ +# Copied from `man swayidle`, except the $ScreenLockCmd that I don't +# want to repeat. +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on +# when resumed. It will also lock your screen before your computer goes to +# sleep. +exec swayidle -w \ + timeout 300 "\"$ScreenLockCmd\"" \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep "\"$ScreenLockCmd\""