소스 검색

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
master
Dave Snider GitHub 4 년 전
부모
커밋
3bd115ef93
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
3개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. +6
    -4
      plugins/imgview
  2. +1
    -1
      plugins/preview-tui
  3. +2
    -2
      plugins/renamer

+ 6
- 4
plugins/imgview 파일 보기

@@ -43,22 +43,24 @@ if uname | grep -q "Darwin"; then
if [ -f "$1" ]; then if [ -f "$1" ]; then
open "$1" >/dev/null 2>&1 & open "$1" >/dev/null 2>&1 &
fi 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 if [ -f "$1" ]; then
view_dir imvr "$1" >/dev/null 2>&1 & view_dir imvr "$1" >/dev/null 2>&1 &
elif [ -d "$1" ] || [ -h "$1" ]; then elif [ -d "$1" ] || [ -h "$1" ]; then
imvr "$1" >/dev/null 2>&1 & imvr "$1" >/dev/null 2>&1 &
fi fi
elif command -v sxiv >/dev/null 2>&1; then
elif which sxiv >/dev/null 2>&1; then
if [ -f "$1" ]; then if [ -f "$1" ]; then
view_dir sxiv "$1" >/dev/null 2>&1 & view_dir sxiv "$1" >/dev/null 2>&1 &
elif [ -d "$1" ] || [ -h "$1" ]; then elif [ -d "$1" ] || [ -h "$1" ]; then
sxiv -qt "$1" >/dev/null 2>&1 & sxiv -qt "$1" >/dev/null 2>&1 &
fi fi
elif command -v viu >/dev/null 2>&1; then
elif which viu >/dev/null 2>&1; then
viu -n "$1" | less -R viu -n "$1" | less -R
else else
printf "install imv/sxiv/viu"
printf "Please install imv/sxiv/viu and check their callable names match the plugin source"
read -r _ read -r _
exit 2 exit 2
fi fi

+ 1
- 1
plugins/preview-tui 파일 보기

@@ -81,7 +81,7 @@ elif [ "$SPLIT" != 'h' ]; then
fi fi


exists() { exists() {
command -v "$1" >/dev/null 2>&1
which "$1" >/dev/null 2>&1
} }


fifo_pager() { fifo_pager() {


+ 2
- 2
plugins/renamer 파일 보기

@@ -14,10 +14,10 @@


selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} 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" batchrenamesel="qmv -fdo -da"
batchrename="qmv -fdo -a" batchrename="qmv -fdo -a"
elif command -v vidir >/dev/null 2>&1; then
elif which vidir >/dev/null 2>&1; then
batchrenamesel="vidir" batchrenamesel="vidir"
batchrename="vidir" batchrename="vidir"
else else


불러오는 중...
취소
저장