Simplify code

This commit is contained in:
Jonatan Pettersson 2024-11-18 20:08:01 +01:00
parent 4d3d283f52
commit 0aed16b23c

View file

@ -258,13 +258,11 @@ pub async fn spawn_desktop_exec<S, I, K, V>(
_ => return,
};
let mut cmd = match terminal {
true => {
let mut cmd = if terminal {
let mut cmd = std::process::Command::new("cosmic-term");
cmd.args(vec!["--", format!("{}", &executable).as_str()]);
cmd
}
false => {
} else {
let mut cmd = std::process::Command::new(&executable);
for arg in exec {
// TODO handle "%" args here if necessary?
@ -273,7 +271,6 @@ pub async fn spawn_desktop_exec<S, I, K, V>(
}
}
cmd
}
};
cmd.envs(env_vars);