swaywm/swayidle

Open lid to trigger resume

palb91 opened this issue · 3 comments

Hi!

Setup:
My config is the most often an external monitor plugged on my laptop and the laptop lid closed.
The swayidle command I use is:

exec swayidle -w                                                 \
    timeout 120  'swaylock'                                      \
    timeout  20  'pgrep swaylock && swaymsg "output * dpms off"' \
         resume  'swaymsg "output * dpms on"'                    \
    before-sleep 'swaylock'

Expected:
This works almost great, if the output is off since few seconds, I can just type my password or move my mouse and everything goes back normaly.

Bug:
However if the output is off for more than few minutes (I don't know how long), the resume stuff is not triggered and I can't wake up my monitors. The only way I have is to open the laptop lid.

Versions:

  • sway: 1:1.2-5 (Arch Linux community)
  • swayidle: 1.5-1 (Arch Linux community)

I think that the external keyboard and mouse are disabled after dpms has been triggered (It does not append when I remove the dpms timeout/resume stuff), I just don't know why and if I can prevent them to

I had a similar issue before. In my case, the issue was that swaylock was launched in non-demonized mode and that prevented resume coomand from being executed. Once I changed the swaylock command from swaylock to swaylock -f, everything went back to normal.

Thanks for your reply @ikalnytskyi.
I use swaylock with a config file where daemonize is set up, it does not seem to be the problem here.

However, I'll try swaylock without config file, directly with the flag.