Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
feat: enhance file revealing functionality on Linux by adding dbus-send support
Tonho42042d2985bb
diff --git a/src-tauri/src/commands/downloads.rs b/src-tauri/src/commands/downloads.rsindex 517bdbe9..f99c4e47 100644--- a/src-tauri/src/commands/downloads.rs+++ b/src-tauri/src/commands/downloads.rs@@ -316,11 +316,33 @@ pub async fn reveal_file(path: String) -> Result<(), String> {#[cfg(target_os = "linux")]{let file_path = std::path::Path::new(&path);- let dir = file_path.parent().unwrap_or(file_path);- std::process::Command::new("xdg-open")- .arg(dir)- .spawn()- .map_err(|e| e.to_string())?;++ let dbus_result = std::process::Command::new("dbus-send")+ .args([+ "--session",+ "--dest=org.freedesktop.FileManager1",+ "--type=method_call",+ "/org/freedesktop/FileManager1",+ "org.freedesktop.FileManager1.ShowItems",+ &format!("array:string:file://{}", file_path.to_string_lossy()),+ "string:",+ ])+ .stdout(std::process::Stdio::null())+ .stderr(std::process::Stdio::null())+ .status();++ match dbus_result {+ Ok(status) if status.success() => {}+ _ => {+ let dir = file_path.parent().unwrap_or(file_path);+ std::process::Command::new("xdg-open")+ .arg(dir)+ .stdout(std::process::Stdio::null())+ .stderr(std::process::Stdio::null())+ .spawn()+ .map_err(|e| e.to_string())?;+ }+ }}Ok(())