swaywm / swayidle

Idle management daemon for Wayland
MIT License
550 stars 50 forks source link

[Help] Using with swaylock, different timeout when swaylock is activated #159

Closed omnigenous closed 9 months ago

omnigenous commented 9 months ago
swayidle -w timeout 300 "swaylock -f" timeout 360 "hyprctl dispatch dpms off" resume "hyprctl dispatch dpms on"

Sometimes I just touch my mouse by accident when my screen is off (from swayidle) and then I would need to wait 360 seconds for my screen to turn off, other times I would go afk and manually use swaylock and then my screen would turn after same 360 seconds.

I want my screen to turn off after 60 seconds if my screen is already locked with swaylock, is this possible or is this another instance of #97 ?

kennylevinsen commented 9 months ago

This is not possible with swayidle, which monitors activity. By definition, there is activity when the mouse is moved, and so all timeouts resume and start at 0.

For these kinds of things, it might be better to have a lockscreen that can turn screens off with its own logic. E.g., "immediately off when launched", "quickly off on just mouse movement or single keypress", "stay on for longer if typed on".

omnigenous commented 9 months ago

By definition, there is activity when the mouse is moved, and so all timeouts resume and start at 0.

I get that, but after timer resets to 0 I would prefer if swayidle turnoff my screen after 60 seconds instead of regular 360 I set if my system is locked with swaylock. Am I not understanding something?

kennylevinsen commented 9 months ago

Swayidle timeouts can only be set when it starts, so this would require you to kill the current swayidle and start a new one whenever you want the timeout to change.

This is why I said it might be better to have the lockscreen contain the logic you want, as that would know what is going on while swayidle only knows if its timeouts have expired.

omnigenous commented 9 months ago

Thank you for clarifying! On the side note, do you have any specific lockscreen software recommendations I could use?