"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/imgview" between
nnn-v4.3.tar.gz and nnn-v4.4.tar.gz

About: nnn is a full-featured terminal file manager.

imgview  (nnn-v4.3):imgview  (nnn-v4.4)
#!/usr/bin/env sh #!/usr/bin/env sh
# Description: Open hovered or current directory in image viewer. # Description: Open hovered or current directory in image viewer.
# Generates media thumbnails with optional dependencies. # Generates media thumbnails with optional dependencies.
# #
# Dependencies: # Dependencies:
# - imv (https://github.com/eXeC64/imv) or, # - imv (https://github.com/eXeC64/imv) or,
# - sxiv (https://github.com/muennich/sxiv) or, # - sxiv (https://github.com/muennich/sxiv) or,
# - nsxiv (https://github.com/nsxiv/nsxiv) or,
# - ucollage (https://github.com/ckardaris/ucollage) or, # - ucollage (https://github.com/ckardaris/ucollage) or,
# - lsix (https://github.com/hackerb9/lsix), or # - lsix (https://github.com/hackerb9/lsix), or
# - viu (https://github.com/atanunq/viu), or # - viu (https://github.com/atanunq/viu), or
# - catimg (https://github.com/posva/catimg), or # - catimg (https://github.com/posva/catimg), or
# - optional: ffmpeg for audio thumbnails (album art) # - optional: ffmpeg for audio thumbnails (album art)
# - optional: ffmpegthumbnailer for video thumbnails # - optional: ffmpegthumbnailer for video thumbnails
# #
# Shell: POSIX compliant # Shell: POSIX compliant
# Author: Arun Prakash Jana, Luuk van Baal # Author: Arun Prakash Jana, Luuk van Baal
# #
skipping to change at line 65 skipping to change at line 66
done done
} }
listimages() { listimages() {
find -L "$dir" "$NNN_PREVIEWDIR$dir" -maxdepth 1 -type f -print0 2>/dev/null | sort -z find -L "$dir" "$NNN_PREVIEWDIR$dir" -maxdepth 1 -type f -print0 2>/dev/null | sort -z
} }
view_files() { view_files() {
[ -f "$target" ] && count="-n $(listimages | grep -a -m 1 -ZznF "$target" | cut -d: -f1)" [ -f "$target" ] && count="-n $(listimages | grep -a -m 1 -ZznF "$target" | cut -d: -f1)"
case "$1" in case "$1" in
nsxiv) listimages | xargs -0 nsxiv -a "${count:--t}" -- ;;
sxiv) listimages | xargs -0 sxiv -a "${count:--t}" -- ;; sxiv) listimages | xargs -0 sxiv -a "${count:--t}" -- ;;
imv*) listimages | xargs -0 "$1" "${count:-}" -- ;; imv*) listimages | xargs -0 "$1" "${count:-}" -- ;;
esac esac
} }
target="$(readlink -f "$1")" target="$(readlink -f "$1")"
[ -d "$target" ] && dir="$target" || dir="${target%/*}" [ -d "$target" ] && dir="$target" || dir="${target%/*}"
if uname | grep -q "Darwin"; then if uname | grep -q "Darwin"; then
[ -f "$1" ] && open "$1" >/dev/null 2>&1 & [ -f "$1" ] && open "$1" >/dev/null 2>&1 &
elif type lsix >/dev/null 2>&1; then elif type lsix >/dev/null 2>&1; then
skipping to change at line 89 skipping to change at line 91
clear clear
lsix lsix
cd "$NNN_PREVIEWDIR$dir" && lsix cd "$NNN_PREVIEWDIR$dir" && lsix
exit_prompt exit_prompt
elif type ucollage >/dev/null 2>&1; then elif type ucollage >/dev/null 2>&1; then
type ffmpeg >/dev/null 2>&1 && make_thumbs 1 type ffmpeg >/dev/null 2>&1 && make_thumbs 1
UCOLLAGE_EXPAND_DIRS=1 ucollage "$dir" "$NNN_PREVIEWDIR$dir" || exit_prompt UCOLLAGE_EXPAND_DIRS=1 ucollage "$dir" "$NNN_PREVIEWDIR$dir" || exit_prompt
elif type sxiv >/dev/null 2>&1; then elif type sxiv >/dev/null 2>&1; then
type ffmpegthumbnailer >/dev/null 2>&1 && make_thumbs 0 type ffmpegthumbnailer >/dev/null 2>&1 && make_thumbs 0
view_files sxiv >/dev/null 2>&1 & view_files sxiv >/dev/null 2>&1 &
elif type nsxiv >/dev/null 2>&1; then
type ffmpegthumbnailer >/dev/null 2>&1 && make_thumbs 0
view_files nsxiv >/dev/null 2>&1 &
elif type imv >/dev/null 2>&1; then elif type imv >/dev/null 2>&1; then
make_thumbs "" make_thumbs ""
view_files imv >/dev/null 2>&1 & view_files imv >/dev/null 2>&1 &
elif type imvr >/dev/null 2>&1; then elif type imvr >/dev/null 2>&1; then
make_thumbs "" make_thumbs ""
view_files imvr >/dev/null 2>&1 & view_files imvr >/dev/null 2>&1 &
elif type viu >/dev/null 2>&1; then elif type viu >/dev/null 2>&1; then
clear clear
make_thumbs 3 viu make_thumbs 3 viu
viu -n "$ret" viu -n "$ret"
exit_prompt exit_prompt
elif type catimg >/dev/null 2>&1; then elif type catimg >/dev/null 2>&1; then
make_thumbs 3 catimg make_thumbs 3 catimg
catimg "$ret" catimg "$ret"
exit_prompt exit_prompt
else else
exit_prompt "Please install sxiv/imv/viu/catimg/lsix." exit_prompt "Please install sxiv/nsxiv/imv/viu/catimg/lsix."
fi fi
 End of changes. 4 change blocks. 
1 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)