diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-10-01 07:35:54 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-10-01 07:35:54 +0530 |
commit | f75620e95b3ed3c48e5ec455f39ca21d188e84d0 (patch) | |
tree | 9b076004bddce9284ab7b3767242c7653e1e7848 /plugins/viuimg | |
parent | 30b5b0ed7242bdddf0cf5018be9966e6f504ef53 (diff) | |
download | nnn-f75620e95b3ed3c48e5ec455f39ca21d188e84d0.tar.gz |
Update plugin viuimg
Diffstat (limited to 'plugins/viuimg')
-rwxr-xr-x | plugins/viuimg | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/plugins/viuimg b/plugins/viuimg index 2659720..200a459 100755 --- a/plugins/viuimg +++ b/plugins/viuimg @@ -1,27 +1,10 @@ #!/usr/bin/env sh -# Description: View an image or images in a directory in pager -# -# Note: While it's very easy to fix this in Bash (sample commented), with the -# current POSIX shell script implementation the unmatched patterns are spewed. -# A patch to fix this is highly appreciated. +# Description: View an image or images in a directory in $PAGER # # Shell: POSIX compliant # Author: Arun Prakash Jana if ! [ -z "$1" ]; then - if [ -d "$1" ]; then - cd "$1" - - # Bash implementation - # shopt -s nullglob - # viu -n *.bmp *.BMP *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.svg *.SVG 2>/dev/null | less -R - - for file in *.bmp *.BMP *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.svg *.SVG - do - viu -n "$file" 2>/dev/null - done | less -R - else - viu -n "$1" | less -R - fi + viu -n "$1" | less -R fi |