diff options
author | Luke Street | 2019-10-07 02:19:11 -0400 |
---|---|---|
committer | Luke Street | 2019-10-07 02:19:11 -0400 |
commit | b2e09a3977e6568d191916cce046c5c20bd67ed1 (patch) | |
tree | 748520fe28713ca9b353f98473c2bfdb8b455e39 | |
download | aur-b2e09a3977e6568d191916cce046c5c20bd67ed1.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 21 | ||||
-rw-r--r-- | detex-thumbnailer | 12 | ||||
-rw-r--r-- | detex.thumbnailer | 4 |
4 files changed, 54 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6ca949fba971 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = detex-thumbnailer + pkgdesc = Thumbnailer for DDS (DirectDraw Surface) and KTX (Khronos Texture) files supporting BC7, ETC1, ETC2 & more + pkgver = 1.0.0 + pkgrel = 1 + url = https://github.com/inequation/detex + arch = x86_64 + license = ISC + depends = detex-convert + depends = xdg-utils + depends = gdk-pixbuf2 + source = detex.thumbnailer + source = detex-thumbnailer + sha256sums = SKIP + sha256sums = SKIP + +pkgname = detex-thumbnailer + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..3d23bd71b93e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,21 @@ +# Maintainer: Luke Street <luke.street@encounterpc.com> + +pkgname=detex-thumbnailer +pkgver=1.0.0 +pkgrel=1 +pkgdesc="Thumbnailer for DDS (DirectDraw Surface) and KTX (Khronos Texture) files supporting BC7, ETC1, ETC2 & more" +arch=(x86_64) +url="https://github.com/inequation/detex" +license=('ISC') +depends=('detex-convert' 'xdg-utils' 'gdk-pixbuf2') +source=('detex.thumbnailer' 'detex-thumbnailer') +sha256sums=('SKIP' 'SKIP') + +package() { + install -Dm755 "$srcdir/detex-thumbnailer" \ + "$pkgdir/usr/bin/detex-thumbnailer" + install -Dm644 "$srcdir/detex.thumbnailer" \ + "$pkgdir/usr/share/thumbnailers/detex.thumbnailer" +} + +# vim:set ts=2 sw=2 et: diff --git a/detex-thumbnailer b/detex-thumbnailer new file mode 100644 index 000000000000..3530b5567fa9 --- /dev/null +++ b/detex-thumbnailer @@ -0,0 +1,12 @@ +#!/bin/sh -e +tmpdir="$(mktemp -d)" +trap '{ rm -r "$tmpdir"; }' EXIT +mime="$(xdg-mime query filetype "$2")" +type="${mime#*/}" +if [ "$type" == "x-dds" ]; then type=dds; fi +# detex-convert requires the extension to be accurate +input="$tmpdir/input.$type" +output="$tmpdir/output.png" +ln -s "$2" "$input" +detex-convert "$input" "$output" +gdk-pixbuf-thumbnailer -s "$1" "$output" "$3"
\ No newline at end of file diff --git a/detex.thumbnailer b/detex.thumbnailer new file mode 100644 index 000000000000..7c7e0c74f4e9 --- /dev/null +++ b/detex.thumbnailer @@ -0,0 +1,4 @@ +[Thumbnailer Entry] +TryExec=detex-thumbnailer +Exec=detex-thumbnailer %s %i %o +MimeType=image/x-dds;image/ktx; |