aboutsummaryrefslogtreecommitdiff
path: root/files/.config/nnn/plugins/nuke
diff options
context:
space:
mode:
Diffstat (limited to 'files/.config/nnn/plugins/nuke')
-rwxr-xr-xfiles/.config/nnn/plugins/nuke12
1 files changed, 7 insertions, 5 deletions
diff --git a/files/.config/nnn/plugins/nuke b/files/.config/nnn/plugins/nuke
index b3eafc8..44e2540 100755
--- a/files/.config/nnn/plugins/nuke
+++ b/files/.config/nnn/plugins/nuke
@@ -226,7 +226,8 @@ handle_extension() {
glow -sdark "${FPATH}" | eval "$PAGER"
exit 0
elif type lowdown >/dev/null 2>&1; then
- lowdown -Tterm "${FPATH}" | eval "$PAGER"
+ cols=$(tput cols)
+ lowdown -Tterm --term-width="$cols" --term-column="$cols" "${FPATH}" | eval "$PAGER"
exit 0
fi
;;
@@ -271,13 +272,13 @@ abspath() {
listimages() {
find -L "///${1%/*}" -maxdepth 1 -type f -print0 |
grep -izZE '\.(jpe?g|png|gif|webp|tiff|bmp|ico|svg)$' |
- sort -z | tee "$tmp"
+ sort -zV | tee "$tmp"
}
load_dir() {
abspath "$2"
tmp="${TMPDIR:-/tmp}/nuke_$$"
- trap 'rm -f $tmp' EXIT
+ trap 'rm -f -- "$tmp"' EXIT
count="$(listimages "$abs_target" | grep -a -m 1 -ZznF "$abs_target" | cut -d: -f1)"
if [ -n "$count" ]; then
@@ -402,7 +403,7 @@ handle_multimedia() {
# "${FPATH}";
# then
# convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \
- # && rm "${preview_png}" \
+ # && rm -- "${preview_png}" \
# && exit 6
# else
# exit 1
@@ -544,12 +545,13 @@ handle_bin() {
esac
}
-MIMETYPE="$( file -bL --mime-type -- "${FPATH}" )"
handle_extension
+MIMETYPE="$( file -bL --mime-type -- "${FPATH}" )"
handle_multimedia "${MIMETYPE}"
handle_mime "${MIMETYPE}"
[ "$BIN" -ne 0 ] && [ -x "${FPATH}" ] && handle_bin
handle_blocked "${MIMETYPE}"
handle_fallback
+# shellcheck disable=SC2317
exit 1