diff options
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | src/config.rs | 4 | ||||
-rw-r--r-- | src/main.rs | 8 |
3 files changed, 13 insertions, 0 deletions
@@ -10,3 +10,4 @@ xkeysym = "0.2.0" [features] debug = ["xcb/debug_atom_names"] +autostart = [] diff --git a/src/config.rs b/src/config.rs index f3b40f6..f052c22 100644 --- a/src/config.rs +++ b/src/config.rs @@ -27,6 +27,10 @@ pub const BORDER_FOCUSED: Colour = Colour::from_hex(0xff0000); /// The main modifier used for keybinds. pub const MAIN_MODIFIER: ModMask = ModMask::CONTROL; +/// Commands to run as soon as setup is done +#[cfg(feature = "autostart")] +pub const AUTOSTART_SCRIPTS: &[&[&str]] = &[]; + /// The keybinds to use. pub const KEYBINDS: Keybinds = Keybinds(&[ bind!(MAIN_MODIFIER , Return -> &|_| spawn::<_, &str>("dmenu_run", [])), diff --git a/src/main.rs b/src/main.rs index ec2475c..1f98801 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,6 +53,14 @@ fn main() -> Result<()> { #[allow(clippy::cast_sign_loss)] let mut wm = WM::new(&conn, screen_num as usize)?; + + #[cfg(feature = "autostart")] + { + for to_start in config::AUTOSTART_SCRIPTS { + helpers::spawn(to_start[0], &to_start[1..]); + } + } + wm.event_loop()?; Ok(()) |