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