diff options
author | Arun <engineerarun@gmail.com> | 2024-04-28 18:16:36 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-28 18:16:36 +0530 |
commit | 2fb7490bf0088aeb27cff6cd1a40bc72257e3c99 (patch) | |
tree | f4d2b474e5122e163afa3a37c6bc5259b9c0845a | |
parent | d61c983dd00942b464eda60a70cfb185326e669b (diff) | |
parent | b20886a29cf7153546ac27e4e990f4ed6fece215 (diff) |
Merge pull request #1834 from TheUtopian/master
preview-tabbed: show sxiv/nsxiv in thumbnail mode when watching Pictures folder
-rwxr-xr-x | plugins/preview-tabbed | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/preview-tabbed b/plugins/preview-tabbed index 68d8d1ab..ab5b2c1f 100755 --- a/plugins/preview-tabbed +++ b/plugins/preview-tabbed @@ -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 [[ -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 |