~j-james/thunar-folder-thumbnails

ec485688cd407bb0983c208dbf2c3267a9a071fc — j-james 10 months ago master
Create custom folder thumbnailer for Tumbler
5 files changed, 62 insertions(+), 0 deletions(-)

A .SRCINFO
A LICENSE
A PKGBUILD
A folder-thumbnailer
A folder.thumbnailer
A  => .SRCINFO +17 -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


A  => LICENSE +5 -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.

A  => PKGBUILD +18 -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"
}

A  => folder-thumbnailer +15 -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

A  => folder.thumbnailer +7 -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