Respect 'Path' desktop entry key
Closes: #1530 XDG desktop entries support an optional key, `Path`, that sets the current working directory to launch an app in.
This commit is contained in:
parent
055d9e371c
commit
b8ee38072f
1 changed files with 6 additions and 0 deletions
|
|
@ -857,7 +857,13 @@ impl App {
|
||||||
Ok(entry) => match entry.exec() {
|
Ok(entry) => match entry.exec() {
|
||||||
Some(exec) => match mime_app::exec_to_command(exec, &[] as &[&str; 0]) {
|
Some(exec) => match mime_app::exec_to_command(exec, &[] as &[&str; 0]) {
|
||||||
Some(commands) => {
|
Some(commands) => {
|
||||||
|
let cwd_opt = entry.desktop_entry("Path");
|
||||||
|
|
||||||
for mut command in commands {
|
for mut command in commands {
|
||||||
|
if let Some(cwd) = cwd_opt {
|
||||||
|
command.current_dir(cwd);
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(err) = spawn_detached(&mut command) {
|
if let Err(err) = spawn_detached(&mut command) {
|
||||||
log::warn!("failed to execute {}: {}", path.display(), err);
|
log::warn!("failed to execute {}: {}", path.display(), err);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue