diff options
author | j-james | 2020-10-21 21:30:57 +0000 |
---|---|---|
committer | j-james | 2020-10-21 21:30:57 +0000 |
commit | ec485688cd407bb0983c208dbf2c3267a9a071fc (patch) | |
tree | ad9916b985db5cf52ab0c749a17b71a7f38bc0f7 |
Create custom folder thumbnailer for Tumbler
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | LICENSE | 5 | ||||
-rw-r--r-- | PKGBUILD | 18 | ||||
-rw-r--r-- | folder-thumbnailer | 15 | ||||
-rw-r--r-- | folder.thumbnailer | 7 |
5 files changed, 62 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..b2bb258 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = tumbler-folder-thumbnailer + pkgdesc = Custom folder thumbnails for Tumbler + pkgver = 1 + pkgrel = 1 + url = https://docs.xfce.org/xfce/tumbler/available_plugins + arch = any + license = BSD + depends = tumbler + depends = imagemagick + optdepends = inkscape: for SVG support + source = folder.thumbnailer + source = folder-thumbnailer + sha512sums = e62c5407390861affdcaf5029f2d7c28d1e623d6361d37a28af0e36cd2dec5c3226d747c608b8b88c5e4deb00197d0d35656963ade5e3a160b0cc29bfcf31bac + sha512sums = e6b5ab3e805dbb187ca1dce12ef18c11595628ecdde68c2b1ded8c19a7c03a828e96b7cebc0af5bddfbdd0587fbad5e91974c2575a7ca764e38ef9b1c717d1e5 + +pkgname = tumbler-folder-thumbnailer + @@ -0,0 +1,5 @@ +Copyright (C) 2020 by j-james <jj@j-james.me> + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..89e8fe1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,18 @@ +pkgname=tumbler-folder-thumbnailer +pkgver=1 +pkgrel=1 +pkgdesc="Custom folder thumbnails for Tumbler" +arch=('any') +url="https://docs.xfce.org/xfce/tumbler/available_plugins" +license=('BSD') +depends=('tumbler' 'imagemagick') +optdepends=('inkscape: for SVG support') +source=('folder.thumbnailer' + 'folder-thumbnailer') +sha512sums=('e62c5407390861affdcaf5029f2d7c28d1e623d6361d37a28af0e36cd2dec5c3226d747c608b8b88c5e4deb00197d0d35656963ade5e3a160b0cc29bfcf31bac' + 'e6b5ab3e805dbb187ca1dce12ef18c11595628ecdde68c2b1ded8c19a7c03a828e96b7cebc0af5bddfbdd0587fbad5e91974c2575a7ca764e38ef9b1c717d1e5') + +package() { + install -Dvm644 "folder.thumbnailer" "$pkgdir/usr/share/thumbnailers/folder.thumbnailer" + install -Dvm755 "folder-thumbnailer" "$pkgdir/usr/bin/folder-thumbnailer" +} diff --git a/folder-thumbnailer b/folder-thumbnailer new file mode 100644 index 0000000..b4b0b5b --- /dev/null +++ b/folder-thumbnailer @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ -f "$2/.folder.jpg" ]; then + convert -thumbnail "$1" "$2/.folder.jpg" "$3" 1>/dev/null 2>&1 +elif [ -f "$2/.folder.png" ]; then + convert -thumbnail "$1" "$2/.folder.png" "$3" 1>/dev/null 2>&1 +elif [ -f "$2/.folder.svg" ]; then + inkscape --export-type=png --export-dpi=500 "$2/.folder.svg" --export-filename="$3" 1>/dev/null 2>&1 + convert -thumbnail "$1" "$3" "$3" 1>/dev/null 2>&1 +else + rm -f "$HOME/.cache/thumbnails/normal/$(echo -n "$4" | md5sum | cut -d " " -f1).png" || \ + rm -f "$HOME/.thumbnails/normal/$(echo -n "$4" | md5sum | cut -d " " -f1).png" || \ + rm -f "$HOME/.cache/thumbnails/large/$(echo -n "$4" | md5sum | cut -d " " -f1).png" || \ + rm -f "$HOME/.thumbnails/large/$(echo -n "$4" | md5sum | cut -d " " -f1).png" +fi diff --git a/folder.thumbnailer b/folder.thumbnailer new file mode 100644 index 0000000..2122e91 --- /dev/null +++ b/folder.thumbnailer @@ -0,0 +1,7 @@ +[Thumbnailer Entry] +Version=1.0 +Encoding=UTF-8 +Type=X-Thumbnailer +Name=Folder Thumbnailer +MimeType=inode/directory; +Exec=/usr/bin/folder-thumbnailer %s %i %o %u |