summarylogtreecommitdiffstats
path: root/detex-thumbnailer
diff options
context:
space:
mode:
authorLuke Street2019-10-07 02:19:11 -0400
committerLuke Street2019-10-07 02:19:11 -0400
commitb2e09a3977e6568d191916cce046c5c20bd67ed1 (patch)
tree748520fe28713ca9b353f98473c2bfdb8b455e39 /detex-thumbnailer
downloadaur-detex-thumbnailer.tar.gz
Initial commit
Diffstat (limited to 'detex-thumbnailer')
-rw-r--r--detex-thumbnailer12
1 files changed, 12 insertions, 0 deletions
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