-
Notifications
You must be signed in to change notification settings - Fork 476
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
Prevent bar being stopped by using signal other than SIGSTOP #701
Conversation
I just checked and it seems to work perfectly. The bar now runs even when hidden. |
Now to think of any pitfalls of doing this... Perhaps we could make it opt-in via a command line argument? |
I was wondering about it too. Maybe it's only bad when someone was expecting that stopping behavior (like a great computational task when the bar is visible). In my use case, I just hide the status bar for appearance reasons I was thinking about a flag in the |
i3 sends SIGSTOP to the bar when it is hidden, which causes the bar to stop updating. This is done for "power savings" and is not configurable in i3 at the moment, which inconveniences users of blocks in i3status-rs that are meant to be running at all times. Luckily i3 lets us customise the signal it sends, so we can set it to something other than SIGSTOP to effectively allow non-interrupted of the bar in all situations. Fixes greshake#503, greshake#694 and possibly others.
b39cbfc
to
532235e
Compare
@GChicha Could you please try with the updated code? |
Didn't work for me. Maybe some differences between i3 and sway. I'm getting If I run without your argument I'm getting only a raw json at status bar. I have no clue what's going on. |
e3b6675
to
f5830f8
Compare
@GChicha Should run now |
Oh sorry, I forgot to answer you. Unfortunately I only could run using SIGCHLD, other signals didn't work. |
I checked the
|
OK so TIL the default action for SIGUSR1/2 is to terminate the process...
|
Since SIGUSR2's default action is to kill the process if there's no handler registered.
@GChicha I just changed it to use SIGCONT instead. When SIGCONT is sent to a running process it is ignored by default, which is what we want. Could you please try again? In the meantime I may try talk to the i3 devs to at least let us turn this feature off so we don't need to come up with hacks like this. |
It appears to be working for me. |
It looks good now. Thank you for your help. And sorry for the late reply. |
I also mentioned this over at i3 and it looks like this PR will end up being the proper solution so I will merge this later on. (Just have to change the signal to '0') |
@GChicha Can you see if this makes any difference with regards to the bar being stopped while hidden?