Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preview-tabbed: show sxiv/nsxiv in thumbnail mode when watching Pictures folder #1834

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
preview-tabbed: show (n)sxiv in thumbnail mode when watching "Picture…
…s" directory
  • Loading branch information
TheUtopian committed Apr 18, 2024
commit b20886a29cf7153546ac27e4e990f4ed6fece215
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
Loading