Add exec command

Fixes #673
This commit is contained in:
Henrik Friedrichsen
2021-12-17 20:50:41 +01:00
parent 8deaedce54
commit 299c470cf9
5 changed files with 27 additions and 14 deletions

View File

@@ -253,6 +253,13 @@ impl CommandManager {
s.quit();
Ok(None)
}
Command::Execute(cmd) => {
log::info!("Executing command: {}", cmd);
let cmd = std::ffi::CString::new(cmd.clone()).unwrap();
let result = unsafe { libc::system(cmd.as_ptr()) };
log::info!("Exit code: {}", result);
Ok(None)
}
Command::Jump(_)
| Command::Move(_, _)
| Command::Shift(_, _)