aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/imgview10
-rwxr-xr-xplugins/preview-tui2
-rwxr-xr-xplugins/renamer4
3 files changed, 9 insertions, 7 deletions
diff --git a/plugins/imgview b/plugins/imgview
index 16d483b..afc0d0f 100755
--- a/plugins/imgview
+++ b/plugins/imgview
@@ -43,22 +43,24 @@ if uname | grep -q "Darwin"; then
if [ -f "$1" ]; then
open "$1" >/dev/null 2>&1 &
fi
-elif command -v imvr >/dev/null 2>&1; then
+# `imvr` is often callable as `imv` on Linux distros
+# You might need to change the reference below
+elif which imvr >/dev/null 2>&1; then
if [ -f "$1" ]; then
view_dir imvr "$1" >/dev/null 2>&1 &
elif [ -d "$1" ] || [ -h "$1" ]; then
imvr "$1" >/dev/null 2>&1 &
fi
-elif command -v sxiv >/dev/null 2>&1; then
+elif which sxiv >/dev/null 2>&1; then
if [ -f "$1" ]; then
view_dir sxiv "$1" >/dev/null 2>&1 &
elif [ -d "$1" ] || [ -h "$1" ]; then
sxiv -qt "$1" >/dev/null 2>&1 &
fi
-elif command -v viu >/dev/null 2>&1; then
+elif which viu >/dev/null 2>&1; then
viu -n "$1" | less -R
else
- printf "install imv/sxiv/viu"
+ printf "Please install imv/sxiv/viu and check their callable names match the plugin source"
read -r _
exit 2
fi
diff --git a/plugins/preview-tui b/plugins/preview-tui
index 8dcdb3c..255c35d 100755
--- a/plugins/preview-tui
+++ b/plugins/preview-tui
@@ -81,7 +81,7 @@ elif [ "$SPLIT" != 'h' ]; then
fi
exists() {
- command -v "$1" >/dev/null 2>&1
+ which "$1" >/dev/null 2>&1
}
fifo_pager() {
diff --git a/plugins/renamer b/plugins/renamer
index 4c15764..68b6ef0 100755
--- a/plugins/renamer
+++ b/plugins/renamer
@@ -14,10 +14,10 @@
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
-if command -v qmv >/dev/null 2>&1; then
+if which qmv >/dev/null 2>&1; then
batchrenamesel="qmv -fdo -da"
batchrename="qmv -fdo -a"
-elif command -v vidir >/dev/null 2>&1; then
+elif which vidir >/dev/null 2>&1; then
batchrenamesel="vidir"
batchrename="vidir"
else