From ac6b31ad0e780850d60ab88a5903e50dc02ac11b Mon Sep 17 00:00:00 2001 From: Oktay Imanzade <50494084+TheUtopian@users.noreply.github.com> Date: Fri, 29 Mar 2024 20:02:04 +0400 Subject: [PATCH] preview-tabbed: fixed not removing tab after leaving PICTURES folder --- plugins/preview-tabbed | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/preview-tabbed b/plugins/preview-tabbed index 7fc859ca..2a66697e 100755 --- a/plugins/preview-tabbed +++ b/plugins/preview-tabbed @@ -181,10 +181,14 @@ previewer_loop () { ;; inode/directory) if [[ -n $PICTURES_DIR && "$FILE" == *"$PICTURES_DIR"* ]] ; then - if type sxiv >/dev/null 2>&1 ; then - ( sxiv -te "$XID" "$FILE" 2>/dev/null || $TERMINAL "$XID" -e nnn "$FILE" ) & - elif type nsxiv >/dev/null 2>&1 ; then - ( nsxiv -te "$XID" "$FILE" 2>/dev/null || $TERMINAL "$XID" -e nnn "$FILE" ) & + if find "$FILE" -maxdepth 1 | file -bLf- --mime-type | grep -q image ; then + if type sxiv >/dev/null 2>&1 ; then + sxiv -te "$XID" "$FILE" & + elif type nsxiv >/dev/null 2>&1 ; then + nsxiv -te "$XID" "$FILE" & + else + $TERMINAL "$XID" -e nnn "$FILE" & + fi else $TERMINAL "$XID" -e nnn "$FILE" & fi