diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-21 19:58:03 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-21 19:58:03 +0400 |
| commit | a7e338b3c0aeb37f7cc6095f27056fc77e1760a7 (patch) | |
| tree | 9f61b1b7966454dd0af7c72da25475f3bc9521cd /src | |
| parent | 80dce054cb8da4a34b1863a7642baeeebf66ebbe (diff) | |
| download | niri-a7e338b3c0aeb37f7cc6095f27056fc77e1760a7.tar.gz niri-a7e338b3c0aeb37f7cc6095f27056fc77e1760a7.tar.bz2 niri-a7e338b3c0aeb37f7cc6095f27056fc77e1760a7.zip | |
Add spawn-at-startup config option
Fixes https://github.com/YaLTeR/niri/issues/12
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.rs | 13 | ||||
| -rw-r--r-- | src/main.rs | 12 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs index 88773fd3..dd664ff8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,6 +13,8 @@ pub struct Config { pub input: Input, #[knuffel(children(name = "output"))] pub outputs: Vec<Output>, + #[knuffel(children(name = "spawn-at-startup"))] + pub spawn_at_startup: Vec<SpawnAtStartup>, #[knuffel(child, default)] pub binds: Binds, #[knuffel(child, default)] @@ -81,6 +83,12 @@ impl Default for Output { } } +#[derive(knuffel::Decode, Debug, Clone, PartialEq, Eq)] +pub struct SpawnAtStartup { + #[knuffel(arguments)] + pub command: Vec<String>, +} + #[derive(knuffel::Decode, Debug, Default, PartialEq, Eq)] pub struct Binds(#[knuffel(children)] pub Vec<Bind>); @@ -286,6 +294,8 @@ mod tests { scale 2.0 } + spawn-at-startup "alacritty" "-e" "fish" + binds { Mod+T { spawn "alacritty"; } Mod+Q { close-window; } @@ -320,6 +330,9 @@ mod tests { name: "eDP-1".to_owned(), scale: 2., }], + spawn_at_startup: vec![SpawnAtStartup { + command: vec!["alacritty".to_owned(), "-e".to_owned(), "fish".to_owned()], + }], binds: Binds(vec