From d4c3205dbec2ea31cb4f6840403b4e684c8a9596 Mon Sep 17 00:00:00 2001 From: j-james Date: Mon, 20 Dec 2021 15:08:24 -0800 Subject: More idiomatically install thumbnailer script --- .SRCINFO | 9 ++++----- PKGBUILD | 11 ++++++----- folder-thumbnailer | 15 --------------- folder-thumbnailer.sh | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 folder-thumbnailer create mode 100644 folder-thumbnailer.sh diff --git a/.SRCINFO b/.SRCINFO index b2bb258..70487ef 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = tumbler-folder-thumbnailer pkgdesc = Custom folder thumbnails for Tumbler pkgver = 1 - pkgrel = 1 + pkgrel = 2 url = https://docs.xfce.org/xfce/tumbler/available_plugins arch = any license = BSD @@ -9,9 +9,8 @@ pkgbase = tumbler-folder-thumbnailer depends = imagemagick optdepends = inkscape: for SVG support source = folder.thumbnailer - source = folder-thumbnailer - sha512sums = e62c5407390861affdcaf5029f2d7c28d1e623d6361d37a28af0e36cd2dec5c3226d747c608b8b88c5e4deb00197d0d35656963ade5e3a160b0cc29bfcf31bac - sha512sums = e6b5ab3e805dbb187ca1dce12ef18c11595628ecdde68c2b1ded8c19a7c03a828e96b7cebc0af5bddfbdd0587fbad5e91974c2575a7ca764e38ef9b1c717d1e5 + source = folder-thumbnailer.sh + sha256sums = 4079476266971a1d6e48360fa3e1ee038ed9e91eb85bc089569ea0dbde3d24d4 + sha256sums = bb9fcf291fe811b9e97f73ba2f6fda4ff9f6216a40a150ddcd725d2c563deac8 pkgname = tumbler-folder-thumbnailer - diff --git a/PKGBUILD b/PKGBUILD index 89e8fe1..70f25e1 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,7 @@ +# Maintainer: j-james pkgname=tumbler-folder-thumbnailer pkgver=1 -pkgrel=1 +pkgrel=2 pkgdesc="Custom folder thumbnails for Tumbler" arch=('any') url="https://docs.xfce.org/xfce/tumbler/available_plugins" @@ -8,11 +9,11 @@ license=('BSD') depends=('tumbler' 'imagemagick') optdepends=('inkscape: for SVG support') source=('folder.thumbnailer' - 'folder-thumbnailer') -sha512sums=('e62c5407390861affdcaf5029f2d7c28d1e623d6361d37a28af0e36cd2dec5c3226d747c608b8b88c5e4deb00197d0d35656963ade5e3a160b0cc29bfcf31bac' - 'e6b5ab3e805dbb187ca1dce12ef18c11595628ecdde68c2b1ded8c19a7c03a828e96b7cebc0af5bddfbdd0587fbad5e91974c2575a7ca764e38ef9b1c717d1e5') + 'folder-thumbnailer.sh') +sha256sums=('4079476266971a1d6e48360fa3e1ee038ed9e91eb85bc089569ea0dbde3d24d4' + 'bb9fcf291fe811b9e97f73ba2f6fda4ff9f6216a40a150ddcd725d2c563deac8') package() { install -Dvm644 "folder.thumbnailer" "$pkgdir/usr/share/thumbnailers/folder.thumbnailer" - install -Dvm755 "folder-thumbnailer" "$pkgdir/usr/bin/folder-thumbnailer" + install -Dvm755 "folder-thumbnailer.sh" "$pkgdir/usr/bin/folder-thumbnailer" } diff --git a/folder-thumbnailer b/folder-thumbnailer deleted file mode 100644 index b4b0b5b..0000000 --- a/folder-thumbnailer +++ /dev/null @@ -1,15 +0,0 @@ -#!/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.sh b/folder-thumbnailer.sh new file mode 100644 index 0000000..b4b0b5b --- /dev/null +++ b/folder-thumbnailer.sh @@ -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 -- cgit v1.2.3-70-g09d2