i3 / i3

A tiling window manager for X11

Home Page:https://i3wm.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

i3bar: allow "power savings" feature to be disabled

ammgws opened this issue · comments

I'm submitting a…

[ ] Bug
[x] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

i3bar has a "power savings" feature that pauses the bar via SIGSTOP when it is hidden or
obscured by a fullscreen app, and this behaviour is not configurable.

Desired Behavior

Power savings mode should be configurable.

Background Information

This "power savings" feature becomes a problem for users who
use status line generators such as i3status-rust that run threads/proccesses that need
to run at all times. A hacky way to prevent this from happening is to set
stop_signal to a signal that won't cause the status line generator program to stop,
however I do not believe that is a good solution.

This has surprised users a fair amount of time over the past few years, to show a few:
greshake/i3status-rust#503
greshake/i3status-rust#694 (comment)
https://faq.i3wm.org/question/4631/dont-sigstop-when-in-hide-mode.1.html
#3242 (comment)
https://www.reddit.com/r/i3wm/comments/gm6yfh/is_there_a_painless_way_to_keep_i3bar_children/

Implementation

I have added a new config option to the bar section that allows the power savings feature to be disabled here: ammgws@c7d4fb5

I am pretty sure you can do this by setting the stop signal to zero

Yeah IIRC the i3 child_stop/child_cont function checks if the signal is > 0, but I thought that was just a check to see if the signal is valid rather than a way to intentionally disable the feature. Plus it's undocumented, and would mean having to add support for that in every affected status line generator program. To me it seems like this obscure feature should be able to be disabled on the i3 side, as mentioned in #3242 as well.

We can bless the feature in the documentation but setting something to zero sounds good enough to me

The caveat would be that adding support for disabling the power saving feature would then need to be implemented by each and every status line generator instead of being able to disable it on the i3 side, but I think I've only seen i3status/i3status-rust/i3block/i3pystatus mentioned with respect to this issue so it might not be that many.

Do you need to talk to the other i3 devs first? Otherwise if you believe just documenting the feature is enough then I will send through a PR for that.

The documentation regarding this feature could certainly be improved in general. I imagine a small paragraph explaining what this does + mentioning 0 for disabling. I would also replace the "processing" term (or define it) since it only appears there in the document.

Do you need to talk to the other i3 devs first?

I doubt that anyone will disagree with improved documentation. If we also want to add an extra option to i3's bar {} it can always happen in the future but my problem is that the option is not really consistent with the nature of the other bar {} options.

would then need to be implemented by each and every status line generator instead of being able to disable it on the i3 side

I guess that the rationale is that this is pretty-much client specific, it depends on what kind of processing the client does and if it can be paused.

Otherwise if you believe just documenting the feature is enough then I will send through a PR for that.

Sure, please send a PR. If you'd prefer it I can do it as well.

I'll close this now but I still think that the feature should be able to be disabled on the i3 side, or just removed altogether if someone runs a test to see how much power is actually saved by stopping bar computations.