preview-tabbed: show sxiv/nsxiv in thumbnail mode when showing Pictures folder

This commit is contained in:
Oktay Imanzade 2024-02-29 03:20:49 +04:00 committed by GitHub
parent f71b1309a9
commit 094f16df5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,6 +69,9 @@ else
echo "No xembed term found" >&2
fi
if type xdg-user-dir >/dev/null 2>&1 ; then
PICTURES_DIR=$(xdg-user-dir PICTURES)
fi
term_nuke () {
# $1 -> $XID, $2 -> $FILE
@ -177,7 +180,17 @@ previewer_loop () {
fi
;;
inode/directory)
$TERMINAL "$XID" -e nnn "$FILE" &
if [[ -z $PICTURES_DIR && "$FILE" == *"$PICTURES_DIR"* ]]; then
if type sxiv >/dev/null 2>&1 ; then
sxiv -te "$XID" "$FILE" 2>/dev/null &
elif type nsxiv >/dev/null 2>&1 ; then
nsxiv -te "$XID" "$FILE" 2>/dev/null &
else
$TERMINAL "$XID" -e nnn "$FILE" &
fi
else
$TERMINAL "$XID" -e nnn "$FILE" &
fi
;;
text/*)
if [ -x "$NUKE" ] ; then