summaryrefslogtreecommitdiffstats
path: root/src/external.rs
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2018-11-23 21:32:58 +0100
committerCanop <cano.petrole@gmail.com>2018-11-23 21:32:58 +0100
commit1a56633b7d9d8cf7f99fd4d44f60ed8365682d27 (patch)
tree5ef0c680258030c16bf939d6295ca5404b84d624 /src/external.rs
parent2781f6b62df8bc84fae0f092b3f3694bfc56a147 (diff)
more command parsing, POC of file opening
Diffstat (limited to 'src/external.rs')
-rw-r--r--src/external.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/external.rs b/src/external.rs
new file mode 100644
index 0000000..a2911a3
--- /dev/null
+++ b/src/external.rs
@@ -0,0 +1,10 @@
+use std::process::Command;
+use std::path::{PathBuf};
+
+pub fn open_file(path: &PathBuf) {
+ Command::new("xdg-open")
+ .arg(String::from(path.to_string_lossy()))
+ .spawn()
+ .expect("xdg-open failed to start");
+}
+