From 2d32dde424d68fd1424aaa5de270aa4c7497d6e7 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 20 Apr 2017 18:44:32 +0530 Subject: [PATCH] scripts/preview: Lookup scope.sh in system folder if not in home --- .scripts/preview | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.scripts/preview b/.scripts/preview index 0958cc95..9982ef3d 100755 --- a/.scripts/preview +++ b/.scripts/preview @@ -33,7 +33,18 @@ fi ## scope.sh. XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config} -buf=$($XDG_CONFIG_HOME/ranger/scope.sh "$1" $(tput cols) $(tput lines) 2>/dev/null) + + +scope="$XDG_CONFIG_HOME/ranger/scope.sh" +if [ ! -x "$scope" ]; then + XDG_DATA_DIRS=${XDG_DATA_DIRS:-"/usr/local/share"} + scope="$XDG_DATA_DIRS/doc/ranger/config/scope.sh" + if [ ! -x "$scope" ]; then + scope="/usr/share/doc/ranger/config/scope.sh" + fi +fi + +buf=$("$scope" "$1" $(tput cols) $(tput lines) 2>/dev/null) status=$? case $status in