oxwm

https://git.tonybtw.com/oxwm.git git://git.tonybtw.com/oxwm.git
493 bytes raw
1
mod config;
2
3
use anyhow::Result;
4
5
fn main() -> Result<()> {
6
    let cfg = config::build_config();
7
8
    let args: Vec<String> = std::env::args().collect();
9
    let mut wm = oxwm::window_manager::WindowManager::new(cfg)?;
10
    let should_restart = wm.run()?;
11
12
    drop(wm);
13
14
    if should_restart {
15
        use std::os::unix::process::CommandExt;
16
        let err = std::process::Command::new(&args[0]).args(&args[1..]).exec();
17
        eprintln!("Failed to restart: {}", err);
18
    }
19
20
    Ok(())
21
}