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

Sway stops responding to idle command from swayidle #7545

Open
pielgrzym opened this issue Apr 21, 2023 · 4 comments
Open

Sway stops responding to idle command from swayidle #7545

pielgrzym opened this issue Apr 21, 2023 · 4 comments
Labels
bug Not working as intended

Comments

@pielgrzym
Copy link

pielgrzym commented Apr 21, 2023

I'm using swayidle with such invocation:

swayidle -w timeout 600 'swaylock' timeout 1200 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock'

I use killall -USR1 swayidle to trigger screen lock.
When I have external monitor attached for longer period of time the USR1 signal does not lock the screen or locks the screen only after I invoke a keybinding to change window. In the log in gist there is a case when the screen actually locked but with 10 minutes delay. When I detach monitor screen locking starts working again. Sometimes reloading sway does the trick without detaching monitor. Other times it just starts working again. It looks like the event produced by swayidle uppon USR1 is consumed by sway with a large delay - perhaps there is some queue that is filled up?

Is there a workaround this problem? This seriously undermines system security when your automatic screen locker works from time to time. Perhaps there is an alternative way I can detect idle and lock screen?

@pielgrzym pielgrzym added the bug Not working as intended label Apr 21, 2023
@pielgrzym pielgrzym changed the title Sway stops responding to idle command from swaymsg Sway stops responding to idle command from swayidle Apr 21, 2023
@joanbm
Copy link
Contributor

joanbm commented Apr 27, 2023

Hmmmm, not sure about the problem with SIGUSR1, but as a workaround, maybe you can lock the screen by running swaylock directly, instead of killall -USR1 swayidle?

(Note that only a single instance of swayidle can run, so the screen won't be "double locked" after 10 minutes).

@pielgrzym
Copy link
Author

Thanks, I actually used this fallback :) swayidle is triggering DPMS after longer inactivity (or not - it's a hit or miss, sometimes it does, othertimes it doesn't).

@joanbm
Copy link
Contributor

joanbm commented Apr 29, 2023

Yeah, not sure if it's related in some way to your issue, but swayidle's handling of SIGUSR1 has some warts like swaywm/swayidle#51 that makes it unusable as a "I'm going away, run all the inactivity triggers right now" button.

@pielgrzym
Copy link
Author

I tried reporting the issue there, but they said it's sway's fault :( I did some tests and for sure the SIGUSR1 is received (debug logs indicate this), however the events are not fired. I looked into swayidle code and there is almost no logic there - everything is handled by ext-idle-notify so I guess this is the faulty part, however I have no idea how to debug this so I can provied an actionable issue. This behavior is so frustrating when you can't know for sure if your screen will lock automatically or if it will shut down for the night :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

2 participants