git.lucas.co / cce-system-interface
system settings
git clone https://git.lucas.co/cce-system-interface.git

src/lib.rs (643B)

 1 mod accounts_file;
 2 pub mod app;
 3 pub mod pages;
 4 pub mod power_meter;
 5 pub mod power_plan;
 6 pub use cce_ui::widget::scroll_region;
 7 pub mod widgets;
 8 pub mod watchers;
 9 
10 /// Spawn a command and reap it from a background thread, so a finished
11 /// xdg-open never lingers as a zombie. cce-ui's `process::spawn_detached`
12 /// did exactly this until cce-ui@4e94236 removed the module; the accounts and
13 /// system-info pages were its remaining callers.
14 pub(crate) fn spawn_detached(mut cmd: std::process::Command) -> std::io::Result<()> {
15     let mut child = cmd.spawn()?;
16     std::thread::spawn(move || {
17         let _ = child.wait();
18     });
19     Ok(())
20 }