Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only the first timeout is triggered when suspending #144

Open
WhyNotHugo opened this issue May 29, 2023 · 3 comments · May be fixed by #156
Open

Only the first timeout is triggered when suspending #144

WhyNotHugo opened this issue May 29, 2023 · 3 comments · May be fixed by #156

Comments

@WhyNotHugo
Copy link

I'm basically running swayidle timeout 10 "powerctl mem" while the screen is locked.

The first time the system reaches 10s idle, swayidle triggers, runs powerctl mem and puts it to sleep. I then press Return to wake the system up. swayidle doesn't trigger ever again.

I think that the keypress is "swallowed" by the system when asleep, so sway doesn't really know that any keypress happened. I wonder if maybe sway itself should reset the idle timer when woken up from sleep...? I don't think it even knows that this happened TBH.

The end result is that swayidle only triggers the first time. To be sincere, I'm not sure if this is a bug of a case of me using it wrong.

@WhyNotHugo
Copy link
Author

I think what I need to do is somehow tell sway to "reset" it's idle timer when the system wakes up from sleep -- which would eventually make swayidle trigger as expected in this case.

I don't think sway has any such mechanism.

@a-priestley
Copy link

I'm having this issue with wake-on-lan. resume will not fire unless triggered by user input it seems.

@fishman
Copy link

fishman commented Nov 22, 2023

I think what I need to do is somehow tell sway to "reset" it's idle timer when the system wakes up from sleep -- which would eventually make swayidle trigger as expected in this case.

That concept doesn't really exist. It's not part of sway it's part of the wayland idle notification protocol.

I just released sleepwatcher-rs(originally intended to call this swayidle-rs) which works around that problem by allowing for more logic in the configuration

https://github.com/fishman/sleepwatcher-rs/blob/master/lua_configs/idle_config.lua

MikeWalrus added a commit to MikeWalrus/swayidle that referenced this issue Dec 2, 2023
This is useful for re-suspending the system when there is no activity after
waking up. Fixes swaywm#144.
MikeWalrus added a commit to MikeWalrus/swayidle that referenced this issue Dec 2, 2023
This is useful for re-suspending the system when there is no activity after
waking up. Fixes swaywm#144.
MikeWalrus added a commit to MikeWalrus/swayidle that referenced this issue Dec 2, 2023
This is useful for re-suspending the system when there is no activity after
waking up. Fixes swaywm#144.
@MikeWalrus MikeWalrus linked a pull request Dec 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants