diff options
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 90126a6..2f5e80c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,6 +30,16 @@ use unix_socket::UnixListener; const SOCKET_PATH: &'static str = "./dotwm.sock"; +fn run_autostart() { + let paths = &["./autostart", "/home/matias/.config/dotwm/autostart"]; + for path in paths { + match exec_cmd(path, &[]) { + Ok(_) => break, + Err(_) => (), + } + } +} + fn main() { println!("Creating dotwm"); let mut dotwm = DotWM::new(); @@ -40,12 +50,12 @@ fn main() { let listener = UnixListener::bind(SOCKET_PATH).unwrap(); - exec_cmd("./autostart", &[]).unwrap(); + run_autostart(); // Main loop while !dotwm.finish { let event = unsafe { select_event(dotwm.display, x11_fd, &listener) }; - println!("Event: {:?}", event); + //println!("Event: {:?}", event); match event { Event::Key(mut e, true) => { let keysym = unsafe { xlib::XLookupKeysym(&mut e, 0) as u32 }; |