Skip to content

Commit

Permalink
Prevent bar being stopped by using signal other than SIGSTOP
Browse files Browse the repository at this point in the history
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 #503, #694 and possibly others.
  • Loading branch information
ammgws committed May 21, 2020
1 parent 7a01fe6 commit 532235e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ fn main() {
#[allow(unused_mut)] // TODO: Remove when fixed in chan_select
fn run(matches: &ArgMatches) -> Result<()> {
// Now we can start to run the i3bar protocol
print!("{{\"version\": 1, \"click_events\": true}}\n[");
print!(
"{}",
format!(
"{{\"version\": 1, \"click_events\": true, \"stop_signal\": {}}}\n[",
nix::sys::signal::Signal::SIGUSR2
)
);

// Read & parse the config file
let config_path = match matches.value_of("config") {
Expand Down

0 comments on commit 532235e

Please sign in to comment.