Skip to content

Commit

Permalink
Merge pull request #1834 from TheUtopian/master
Browse files Browse the repository at this point in the history
preview-tabbed: show sxiv/nsxiv in thumbnail mode when watching Pictures folder
  • Loading branch information
jarun authored Apr 28, 2024
2 parents d61c983 + b20886a commit 2fb7490
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion plugins/preview-tabbed
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -177,7 +180,17 @@ previewer_loop () {
fi
;;
inode/directory)
$TERMINAL "$XID" -e nnn "$FILE" &
if [[ -n $PICTURES_DIR && "$FILE" == "$PICTURES_DIR"* ]] ; 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
;;
text/*)
if [ -x "$NUKE" ] ; then
Expand Down

0 comments on commit 2fb7490

Please sign in to comment.