preview-tabbed: fixed not removing tab after leaving PICTURES folder

This commit is contained in:
Oktay Imanzade 2024-03-29 20:02:04 +04:00 committed by GitHub
parent 0c28e160b8
commit ac6b31ad0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 4 deletions

View File

@ -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