.config/sway/idle-screenlock-put-in-definitions.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
### Idle configuration # 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. # set $idle_timeout 240 set $locking_timeout 300 set $screen_timeout 600 set $sleep_timeout 900 set $sleep_delay 2 set $swayidle swayidle -w \ timeout $idle_timeout 'light -G > /tmp/brightness && light -S 10' resume 'light -S $([ -f /tmp/brightness ] && cat /tmp/brightness || echo 100%)' \ timeout $locking_timeout 'exec $locking' \ timeout $screen_timeout 'swaymsg "output * dpms off"' \ resume 'swaymsg "output * dpms on"' \ timeout $sleep_timeout 'swaymsg "output * dpms on"; sleep $sleep_delay; systemctl suspend' \ before-sleep 'playerctl pause' \ before-sleep 'exec $locking & sleep $sleep_delay' |