aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/imgview
diff options
context:
space:
mode:
authorGravatar Dave Snider <dave.snider@gmail.com>2020-08-29 15:56:55 -0700
committerGravatar GitHub <noreply@github.com>2020-08-30 04:26:55 +0530
commit3bd115ef936e67313b1395b2bf5cbcc3002dbd19 (patch)
tree426e75a14c4f41eadd108c7fbab8c1ecafdd7cff /plugins/imgview
parentf79af220c7c3683636f50de94e97816171c1f651 (diff)
downloadnnn-3bd115ef936e67313b1395b2bf5cbcc3002dbd19.tar.gz
Add comment for imv command in imgview plugin. Check with which instead of version (#715)
* change version checks to `which` instead. add comments around imvr in linux * add which checks for renamer and preview-tui as well
Diffstat (limited to 'plugins/imgview')
-rwxr-xr-xplugins/imgview10
1 files changed, 6 insertions, 4 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