hyprwm / hypridle

Hyprland's idle daemon
BSD 3-Clause "New" or "Revised" License
320 stars 16 forks source link

timer keeps running while sleeping #73

Open ehula opened 2 weeks ago

ehula commented 2 weeks ago

I have one of my listeners set to suspend. However, if I manually suspend (like close the lid), it seems that hypridle's timer keeps running. If I don't resume my laptop until after the suspend timeout period has lapsed, as soon as my laptop finishes resuming, hypridle immediately suspends it again.

Can you either pause the timer while sleeping, or reset the timer or restart hypridle on resume?

This was not a problem with swayidle.

saharshbhansali commented 6 days ago

Yup, I am facing the same issue.

I tried to inhibit the suspension by using a "lock" file:

on-timeout = cat /tmp/hypridle-lock || touch /tmp/hypridle-lock && systemctl suspend

and

on-resume = rm /tmp/hypridle-lock

And also doing the same when I encounter a lid close event and lid open event.

But it seems like that workaround fails.

muni-corn commented 3 days ago

can confirm i'm facing the same issue. this happens on both my desktop and my laptop. suspending and then immediately waking is fine, but waking after a long time of sleep (my sleep timeout is set to 30 minutes) causes the system to immediately suspend again.

saharshbhansali commented 3 days ago

And also doing the same when I encounter a lid close event and lid open event.

But it seems like that workaround fails.

I've also tried another workaround, which is to kill hypridle using bindl = , switch:on:Lid Switch, ..., and then run the same commands used in the on-resume section of each listener along with restarting hypridle with switch:off:Lid Switch.

Killing hypridle works, and the timer stops (cause duh), but hypridle doesn't restart, nor do the on-resume section commands seem to run properly.

So, in the end, this workaround appears to fail as well.

HarshNarayanJha commented 1 day ago

The exact same behavior is occurring to me also. Laptop immediately suspends when I open the lid.