diff --git a/apps/readest-app/src-tauri/src/lib.rs b/apps/readest-app/src-tauri/src/lib.rs index 7d8013a8..0e48a60f 100644 --- a/apps/readest-app/src-tauri/src/lib.rs +++ b/apps/readest-app/src-tauri/src/lib.rs @@ -220,12 +220,30 @@ pub fn run() { }); } - #[cfg(any(windows, target_os = "linux"))] + #[cfg(target_os = "windows")] { use tauri_plugin_deep_link::DeepLinkExt; app.deep_link().register_all()?; } + #[cfg(target_os = "linux")] + { + fn has_xdg_mime() -> bool { + std::process::Command::new("which") + .arg("xdg-mime") + .output() + .map(|output| output.status.success()) + .unwrap_or(false) + } + + if has_xdg_mime() { + use tauri_plugin_deep_link::DeepLinkExt; + app.deep_link().register_all()?; + } else { + println!("xdg-mime not found; skipping deep link setup on Linux."); + } + } + app.handle().plugin( tauri_plugin_log::Builder::default() .level(log::LevelFilter::Info)