swaywm/swayidle

wrong ordering or broken forking

lanodan opened this issue · 1 comments

I have the following configuration on my laptop:

exec swayidle -w \
        timeout 30 'swaymsg output * dpms off' \
        resume 'swaymsg output * dpms on' \
        timeout 60 locker \
        timeout 80 memsys

locker is just a shell script which wraps around swaylock, memsys is a small setuid program which suspends my machine.

What I expected was something like:

  • 30 seconds after no activity, turn off the screens ; turn them on on resuming (is that even needed?)
  • 60 seconds after no activity, lock the session
  • 80 seconds after no activity, suspend the machine

What I seem to get: Some time (probably 60 seconds) after no activity screen gets locked; if it was after more time (the 80 seconds I guess) of inactivity my laptop gets suspended right after unlocking it. Screen (Laptop's LCD, didn't try an external screen) is never blanked.

If you use the swayidle -w flag, you need to make each command fork, e.g. by using swaylock's -f. Blocking in a process will also block swayidle.