From 7f708df9bd161132e41b29896910e119587e0bb0 Mon Sep 17 00:00:00 2001 From: rabite Date: Thu, 23 May 2019 21:20:35 +0200 Subject: use xdg-open exclusively --- README.md | 2 +- src/file_browser.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 48893f1..8280691 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ cargo install (--no-default-features --features=...) --path . ``` ## NOTE: -hunter uses [ranger's rifle](https://github.com/ranger/ranger/blob/master/ranger/ext/rifle.py) to open files if rifle is in your $PATH. If it can't find rifle it uses xdg-open. It also uses ranger's scope.sh to generate previews for non-text files. A slightly modified version is included in the "extra" directory. Put it in your $PATH somewhere if you want previews for non-text files. +hunter uses ranger's scope.sh to generate previews for non-text files. A slightly modified version is included in the "extra" directory. Put it in your $PATH somewhere if you want previews for non-text files. ## Configuration hunter reads $XDG_CONFIG_HOME/hunter/config at startup. On macOS it simply reads ~/.config/hunter/config. There are a few options which can be set. The configuration file is read asynchronously, so if it's not read by the time hunter starts drawing you will see its default configuration until the config file is read. Options can be set like this (default config): diff --git a/src/file_browser.rs b/src/file_browser.rs index e01f4b8..ad15d01 100644 --- a/src/file_browser.rs +++ b/src/file_browser.rs @@ -409,7 +409,7 @@ impl FileBrowser { self.core.get_sender().send(Events::InputEnabled(false))?; self.core.screen.suspend().log(); - let status = std::process::Command::new("rifle") + let status = std::process::Command::new("xdg-open") .args(file.path.file_name()) .status(); @@ -421,10 +421,10 @@ impl FileBrowser { match status { Ok(status) => self.core.show_status(&format!("\"{}\" exited with {}", - "rifle", status)).log(), + "xdg-open", status)).log(), Err(err) => self.core.show_status(&format!("Can't run this \"{}\": {}", - "rifle", err)).log() + "xdg-open", err)).log() } } Ok(()) -- cgit v1.2.3