From b8ee38072fc0d97dddb8996e327bd2e59da8ea54 Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Thu, 29 Jan 2026 15:49:21 -0500 Subject: [PATCH] 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. --- src/app.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app.rs b/src/app.rs index b1049db..2cd2a8c 100644 --- a/src/app.rs +++ b/src/app.rs @@ -857,7 +857,13 @@ impl App { Ok(entry) => match entry.exec() { Some(exec) => match mime_app::exec_to_command(exec, &[] as &[&str; 0]) { Some(commands) => { + let cwd_opt = entry.desktop_entry("Path"); + for mut command in commands { + if let Some(cwd) = cwd_opt { + command.current_dir(cwd); + } + if let Err(err) = spawn_detached(&mut command) { log::warn!("failed to execute {}: {}", path.display(), err); }