summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.rs4
-rw-r--r--src/main.rs8
2 files changed, 12 insertions, 0 deletions
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(())