+2
-1
changelog
+2
-1
changelog
+19
-4
src-tauri/src/frontend_calls/open_folder.rs
+19
-4
src-tauri/src/frontend_calls/open_folder.rs
···
7
7
8
8
#[cfg(target_os = "linux")]
9
9
{
10
-
let url = url.replace("\\", "/");
11
-
let mut path: Vec<&str> = url.split("/").collect();
10
+
let path = url.replace("\\", "/");
11
+
12
+
let mut dir_path: Vec<_> = path.split("/").collect();
13
+
dir_path.pop();
14
+
let dir_path = dir_path.join("/");
15
+
16
+
let commands = vec![
17
+
( "nautilus", vec![ path.clone() ] ),
18
+
( "nemo", vec![ path.clone() ] ),
19
+
( "thunar", vec![ path.clone() ] ),
20
+
( "caja", vec![ "--select".into(), path.clone() ] ),
21
+
( "pcmanfm-qt", vec![ dir_path.clone() ] ),
22
+
( "pcmanfm", vec![ dir_path.clone() ] ),
23
+
( "dolphin", vec![ "--select".into(), path.clone() ] ),
24
+
( "konqueror", vec![ "--select".into(), path.clone() ] ),
25
+
( "xdg-open", vec![ dir_path.clone() ] )
26
+
];
12
27
13
-
path.pop();
14
-
Command::new("xdg-open").arg(path.join("/")).spawn().unwrap();
28
+
for command in commands{
29
+
if Command::new(command.0).args(command.1).spawn().is_ok() { break; } }
15
30
}
16
31
}