1
0
mirror of https://github.com/pcvolkmer/checkbar.git synced 2025-04-19 19:16:50 +00:00

Start all command processes without waiting to finish another one

This commit is contained in:
Paul-Christian Volkmer 2022-03-05 17:09:36 +01:00
parent fbc5237a8e
commit f7d1df03e0
2 changed files with 4 additions and 10 deletions

View File

@ -35,7 +35,7 @@ You can optionally specify `check_type`:
=== Execute commands === Execute commands
_This feature is experimental and starts further commands only after previous commands have been finished._ _This feature is still experimental._
You can also specify a command to be executed when a mouse click occurs on a checked host. You can also specify a command to be executed when a mouse click occurs on a checked host.
Use `click_cmd` to specifiy the command to be executed, e.g. Use `click_cmd` to specifiy the command to be executed, e.g.

View File

@ -132,17 +132,11 @@ async fn get_click_cmd(name: String) -> Option<String> {
} }
async fn run_click_cmd(cmd: String) { async fn run_click_cmd(cmd: String) {
let _r = match std::process::Command::new("sh") if let Ok(mut child) = std::process::Command::new("sh")
.stdin(std::process::Stdio::piped()) .stdin(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped()) .spawn() {
.spawn()
{
Ok(mut child) => {
use std::io::Write; use std::io::Write;
let _r = child.stdin.as_mut().unwrap().write_all(cmd.as_bytes()); let _ = child.stdin.as_mut().unwrap().write_all(cmd.as_bytes());
child.wait()
}
Err(e) => Err(e),
}; };
} }