swaywm/swayidle

add short delay to allow fast resume without password lock

cypa opened this issue · 1 comments

cypa commented

How do I add delay to allow fast resume without password lock?
I've tried this

exec swayidle -w \
         timeout 255 'swaymsg "output * dpms off"' \
         timeout 300 'swaylock -f -c 000000' \
              resume 'swaymsg "output * dpms on"' \
         before-sleep 'swaylock -f -c 000000'

but no success, if I keypress immediately after display turn off it asks for password anyway.

cypa commented

Looks like I've found the correct config:

 exec swayidle -w \
          timeout 295 'swaymsg "output * dpms off"' \
               resume 'swaymsg "output * dpms on"' \
          timeout 301 'swaylock -f -c 000000' \
               resume 'swaymsg "output * dpms on"' \
          before-sleep 'swaylock -f -c 000000'