From 14350b94a81ffaf30d15ad7c69911b2a52b8e563 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sun, 18 Apr 2021 12:58:50 +0200 Subject: [PATCH] preview-tui-ext: pass env --- plugins/preview-tui-ext | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/preview-tui-ext b/plugins/preview-tui-ext index 29554548..a1f64b22 100755 --- a/plugins/preview-tui-ext +++ b/plugins/preview-tui-ext @@ -168,7 +168,7 @@ preview_file() { if [ -d "$1" ]; then cd "$1" || return if exists tree; then - if [ "$ICONLOOKUP" -ne 0 ]; then + if [ "$ICONLOOKUP" -ne 0 ] && [ -f "$(dirname "$0")"/.iconlookup ]; then [ "$SPLIT" = h ] && BSTR="\n" tree -L 1 --dirsfirst -F --noreport -i | head -n "$((lines - 3))" | "$(dirname "$0")"/.iconlookup -l "$cols" -B "$BSTR" -b " " else @@ -183,7 +183,7 @@ preview_file() { if [ "${mimetype%%/*}" = "image" ]; then if [ "${mimetype#*/}" = "gif" ] && exists convert; then generate_preview "$cols" "$lines" "$1" "gif" - elif [ ! "${mimetype#*/}" = "jpeg" ]; then + elif [ "${mimetype#*/}" != "jpeg" ]; then generate_preview "$cols" "$lines" "$1" "image" else image_preview "$cols" "$lines" "$1" @@ -366,7 +366,9 @@ if [ "$TERMINAL" = "tmux" ]; then # tmux splits are inverted if [ "$SPLIT" = "v" ]; then SPLIT="h"; else SPLIT="v"; fi - tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -e "SPLIT=$SPLIT" -d"$SPLIT" "$0" "$1" + tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -e "PAGER=$PAGER" \ + -e "USE_SCOPE=$USE_SCOPE" -e "SPLIT=$SPLIT" -e "USE_PISTOL=$USE_PISTOL" \ + -e "ICONLOOKUP=$ICONLOOKUP" -d"$SPLIT" "$0" "$1" elif [ "$TERMINAL" = "kitty" ]; then # Setting the layout for the new window. It will be restored after the # script ends. @@ -379,7 +381,7 @@ elif [ "$TERMINAL" = "kitty" ]; then --cwd "$PWD" --env "PATH=$PATH" --env "NNN_FIFO=$NNN_FIFO" \ --env "PREVIEW_MODE=1" --env "PAGER=$PAGER" \ --env "USE_SCOPE=$USE_SCOPE" --env "SPLIT=$SPLIT" \ - --env "USE_PISTOL=$USE_PISTOL" \ + --env "USE_PISTOL=$USE_PISTOL" --env "ICONLOOKUP=$ICONLOOKUP" \ --location "${SPLIT}split" "$0" "$1" >/dev/null else PREVIEW_MODE=1 $TERMINAL -e "$0" "$1" &