"Fossies" - the Fresh Open Source Software Archive  

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

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

nuke  (nnn-v4.3):nuke  (nnn-v4.4)
skipping to change at line 54 skipping to change at line 54
# pdf: zathura (GUI), pdftotext, mutool, exiftool # pdf: zathura (GUI), pdftotext, mutool, exiftool
# audio: mocq (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool # audio: mocq (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool
# avi|mkv|mp4: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool # avi|mkv|mp4: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool
# log: vi # log: vi
# torrent: rtorrent, transmission-show # torrent: rtorrent, transmission-show
# odt|ods|odp|sxw: odt2txt # odt|ods|odp|sxw: odt2txt
# md: glow (https://github.com/charmbracelet/glow), lowdown (https://krista ps.bsd.lv/lowdown) # md: glow (https://github.com/charmbracelet/glow), lowdown (https://krista ps.bsd.lv/lowdown)
# htm|html|xhtml: w3m, lynx, elinks # htm|html|xhtml: w3m, lynx, elinks
# json: jq, python (json.tool module) # json: jq, python (json.tool module)
# Multimedia by mime: # Multimedia by mime:
# image/*: imv/sxiv (GUI), viu (https://github.com/atanunq/viu), img2txt, e xiftool # image/*: imv/sxiv/nsxiv (GUI), viu (https://github.com/atanunq/viu), img2 txt, exiftool
# video/*: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool # video/*: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool
# audio/*: mocq (nnn plugin using MOC), mpv, media_client (Haiku), mediainf o, exiftool # audio/*: mocq (nnn plugin using MOC), mpv, media_client (Haiku), mediainf o, exiftool
# application/pdf: zathura (GUI), pdftotext, mutool, exiftool # application/pdf: zathura (GUI), pdftotext, mutool, exiftool
# Other mimes: # Other mimes:
# text/troff: man -l # text/troff: man -l
# text/* | */xml: vi # text/* | */xml: vi
# image/vnd.djvu): djvutxt, exiftool # image/vnd.djvu): djvutxt, exiftool
# #
# TODO: # TODO:
# 1. Adapt, test and enable all mimes # 1. Adapt, test and enable all mimes
skipping to change at line 262 skipping to change at line 262
jq --color-output . "${FPATH}" | eval "$PAGER" jq --color-output . "${FPATH}" | eval "$PAGER"
exit 0 exit 0
elif type python >/dev/null 2>&1; then elif type python >/dev/null 2>&1; then
python -m json.tool -- "${FPATH}" | eval "$PAGER" python -m json.tool -- "${FPATH}" | eval "$PAGER"
exit 0 exit 0
fi fi
;; ;;
esac esac
} }
# sets the variable abs_target, this should be faster than calling printf
abspath() { abspath() {
case "$1" in case "$1" in
/*) printf "%s\n" "$1";; /*) abs_target="$1";;
*) printf "%s\n" "$PWD/$1";; *) abs_target="$PWD/$1";;
esac esac
} }
# storing the result to a tmp file is faster than calling listimages twice
listimages() { listimages() {
find -L "$(dirname "$target")" -maxdepth 1 -type f -iregex \ find -L "///${1%/*}" -maxdepth 1 -type f -print0 |
'.*\(jpe?g\|bmp\|webp\|ico\|svg\|png\|gif\)$' -print0 | sort -z grep -izZE '\.(jpe?g|png|gif|webp|tiff|bmp|ico|svg)$' |
sort -z | tee "$tmp"
} }
load_dir() { load_dir() {
target="$(abspath "$2")" abspath "$2"
count="$(listimages | grep -a -m 1 -ZznF "$target" | cut -d: -f1)" tmp="${TMPDIR:-/tmp}/nuke_$$"
trap 'rm -f $tmp' EXIT
count="$(listimages "$abs_target" | grep -a -m 1 -ZznF "$abs_target" | cut -
d: -f1)"
if [ -n "$count" ]; then if [ -n "$count" ]; then
if [ "$GUI" -ne 0 ]; then if [ "$GUI" -ne 0 ]; then
listimages | xargs -0 nohup "$1" -n "$count" -- xargs -0 nohup "$1" -n "$count" -- < "$tmp"
else else
listimages | xargs -0 "$1" -n "$count" -- xargs -0 "$1" -n "$count" -- < "$tmp"
fi fi
else else
shift shift
"$1" -- "$@" # fallback "$1" -- "$@" # fallback
fi fi
} }
handle_multimedia() { handle_multimedia() {
## Size of the preview if there are multiple options or it has to be ## Size of the preview if there are multiple options or it has to be
## rendered from vector graphics. If the conversion program allows ## rendered from vector graphics. If the conversion program allows
skipping to change at line 322 skipping to change at line 327
if [ "$GUI" -ne 0 ]; then if [ "$GUI" -ne 0 ]; then
if is_mac; then if is_mac; then
nohup open "${FPATH}" >/dev/null 2>&1 & nohup open "${FPATH}" >/dev/null 2>&1 &
exit 0 exit 0
elif type imvr >/dev/null 2>&1; then elif type imvr >/dev/null 2>&1; then
load_dir imvr "${FPATH}" >/dev/null 2>&1 & load_dir imvr "${FPATH}" >/dev/null 2>&1 &
exit 0 exit 0
elif type sxiv >/dev/null 2>&1; then elif type sxiv >/dev/null 2>&1; then
load_dir sxiv "${FPATH}" >/dev/null 2>&1 & load_dir sxiv "${FPATH}" >/dev/null 2>&1 &
exit 0 exit 0
elif type nsxiv >/dev/null 2>&1; then
load_dir nsxiv "${FPATH}" >/dev/null 2>&1 &
exit 0
fi fi
elif type viu >/dev/null 2>&1; then elif type viu >/dev/null 2>&1; then
viu -n "${FPATH}" | eval "$PAGER" viu -n "${FPATH}" | eval "$PAGER"
exit 0 exit 0
elif type img2txt >/dev/null 2>&1; then elif type img2txt >/dev/null 2>&1; then
img2txt --gamma=0.6 -- "${FPATH}" | eval "$PAGER" img2txt --gamma=0.6 -- "${FPATH}" | eval "$PAGER"
exit 0 exit 0
elif type exiftool >/dev/null 2>&1; then elif type exiftool >/dev/null 2>&1; then
exiftool "${FPATH}" | eval "$PAGER" exiftool "${FPATH}" | eval "$PAGER"
exit 0 exit 0
 End of changes. 9 change blocks. 
9 lines changed or deleted 18 lines changed or added

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