diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-27 17:05:20 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-27 17:05:20 +0400 |
| commit | eacafc270871625d05800c6c861df5239c992fad (patch) | |
| tree | f98a76a9ddd518e4458f06e710adbe00e90be0ac /src | |
| parent | 5c8bcf588dc873902d78835623b15c3dc7097a49 (diff) | |
| download | niri-eacafc270871625d05800c6c861df5239c992fad.tar.gz niri-eacafc270871625d05800c6c861df5239c992fad.tar.bz2 niri-eacafc270871625d05800c6c861df5239c992fad.zip | |
Remove default alacritty and add ability to pass args to command
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index bb5133ba..e2c42cba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,8 +29,9 @@ use winit::Winit; #[derive(Parser)] #[command(author, version, about, long_about = None)] struct Cli { + /// Command to run upon compositor startup. #[arg(last = true)] - command: Option<OsString>, + command: Vec<OsString>, } pub struct LoopData { @@ -98,13 +99,10 @@ fn main() { winit.init(&mut data.niri); } - let res = if let Some(command) = &cli.command { - std::process::Command::new(command).spawn() - } else { - std::process::Command::new("alacritty").spawn() - }; - if let Err(err) = res { - warn!("error spawning command: {err}"); + if let Some((command, args)) = cli.command.split_first() { + if let Err(err) = std::process::Command::new(command).args(args).spawn() { + warn!("error spawning command: {err:?}"); + } } event_loop |
