diff options
-rw-r--r-- | ranger/config/rifle.conf | 3 | ||||
-rw-r--r-- | ranger/core/actions.py | 5 | ||||
-rwxr-xr-x | ranger/data/scope.sh | 2 | ||||
-rwxr-xr-x | ranger/ext/rifle.py | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index 95e4242a..76a3f4f3 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -201,3 +201,6 @@ label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@" label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" + +# The very last action, so that it's never triggered accidently, is to execute a program: +mime application/x-executable = "$1" diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 04932f3f..26dcf4f7 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -134,8 +134,9 @@ class Actions(FileManagerAware, SettingsAware): cwd = self.thisdir except: pass - cwd.unload() - cwd.load_content() + else: + cwd.unload() + cwd.load_content() def notify(self, text, duration=4, bad=False): """:notify <text> diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index add6fbc8..afaf131f 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -30,7 +30,7 @@ maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln # Find out something about the file: mimetype=$(file --mime-type -Lb "$path") -extension=$(/bin/echo "${path##*.}" | tr "[:upper:]" "[:lower:]") +extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}') # Functions: # runs a command and saves its output into $output. Useful if you need diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py index 504851b1..5d13a5bf 100755 --- a/ranger/ext/rifle.py +++ b/ranger/ext/rifle.py @@ -231,7 +231,7 @@ class Rifle(object): self._app_flags = argument return True elif function == 'X': - return 'DISPLAY' in os.environ + return sys.platform == 'darwin' or 'DISPLAY' in os.environ elif function == 'env': return bool(os.environ.get(argument)) elif function == 'else': |