Skip to content

Commit

Permalink
Merge pull request #701 from ammgws/dontstoptilyougetenough
Browse files Browse the repository at this point in the history
Prevent bar being stopped by using signal other than SIGSTOP
  • Loading branch information
ammgws authored May 31, 2020
2 parents 941927d + e99bb54 commit 4c8a01b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ fn main() {
.long("exit-on-error")
.takes_value(false),
)
.arg(
Arg::with_name("never-pause")
.help("Ignore any attempts by i3 to pause the bar when hidden/fullscreen")
.long("never-pause")
.takes_value(false),
)
.arg(
Arg::with_name("one-shot")
.help("Print blocks once and exit")
Expand Down Expand Up @@ -108,7 +114,15 @@ fn main() {

fn run(matches: &ArgMatches) -> Result<()> {
// Now we can start to run the i3bar protocol
print!("{{\"version\": 1, \"click_events\": true}}\n[");
let initialise = if matches.is_present("never-pause") {
format!(
"\"version\": 1, \"click_events\": true, \"stop_signal\": {}",
nix::sys::signal::Signal::SIGCONT as i8
)
} else {
"\"version\": 1, \"click_events\": true".to_string()
};
print!("{{{}}}\n[", initialise);

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

0 comments on commit 4c8a01b

Please sign in to comment.