[Goodies-commits] r2304 - thunar-thumbnailers/trunk/tex-thumbnailer

Erlend Davidson erland at xfce.org
Sun Jan 7 00:26:48 CET 2007


Author: erland
Date: 2007-01-06 23:26:48 +0000 (Sat, 06 Jan 2007)
New Revision: 2304

Added:
   thunar-thumbnailers/trunk/tex-thumbnailer/Makefile.am
   thunar-thumbnailers/trunk/tex-thumbnailer/tex-thumbnailer
   thunar-thumbnailers/trunk/tex-thumbnailer/tex-thumbnailer.desktop.in
Log:
The ps and tex thumbnailers

Added: thunar-thumbnailers/trunk/tex-thumbnailer/Makefile.am
===================================================================
--- thunar-thumbnailers/trunk/tex-thumbnailer/Makefile.am	                        (rev 0)
+++ thunar-thumbnailers/trunk/tex-thumbnailer/Makefile.am	2007-01-06 23:26:48 UTC (rev 2304)
@@ -0,0 +1,20 @@
+# $Id: Makefile.am 2296 2007-01-03 11:30:08Z benny $
+
+libexec_SCRIPTS =							\
+	tex-thumbnailer
+
+desktopdir = $(datadir)/thumbnailers
+desktop_in_files =							\
+	tex-thumbnailer.desktop.in
+%.desktop: %.desktop.in
+	sed -e "s,\@libexecdir\@,$(libexecdir),g" < $< > $@
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+
+EXTRA_DIST =								\
+	$(desktop_in_files)						\
+	$(libexec_SCRIPTS)
+
+DISTCLEANFILES =							\
+	$(desktop_DATA)
+
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:

Added: thunar-thumbnailers/trunk/tex-thumbnailer/tex-thumbnailer
===================================================================
--- thunar-thumbnailers/trunk/tex-thumbnailer/tex-thumbnailer	                        (rev 0)
+++ thunar-thumbnailers/trunk/tex-thumbnailer/tex-thumbnailer	2007-01-06 23:26:48 UTC (rev 2304)
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# tex-thumbnailer - Thumbnailer script for TEX (TeX/LaTeX) files.
+#
+# Usage: tex-thumbnailer tex-file png-file size
+#
+
+# command line parameters
+ifile=$1
+ofile=$2
+size=$3
+
+file=`basename "${ifile}" .tex`
+mkdir "/tmp/${file}"
+tmpfile="/tmp/${file}/${file}.dvi"
+# the output file will be called ${file}.dvi where ${file}=`basename $ifile .tex`
+file=`basename "${ifile}" .tex`
+
+latex -interaction=nonstopmode -output-directory=/tmp/${file} "$ifile"
+
+if [ ! -f ${tmpfile} ]; then
+    exit 1
+fi
+
+convert "dvi:${tmpfile}[0]" -scale "$sizex$size" "png:${ofile}"
+
+# clean up temporary files
+rm -r /tmp/${file}
\ No newline at end of file

Added: thunar-thumbnailers/trunk/tex-thumbnailer/tex-thumbnailer.desktop.in
===================================================================
--- thunar-thumbnailers/trunk/tex-thumbnailer/tex-thumbnailer.desktop.in	                        (rev 0)
+++ thunar-thumbnailers/trunk/tex-thumbnailer/tex-thumbnailer.desktop.in	2007-01-06 23:26:48 UTC (rev 2304)
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Encoding=UTF-8
+Type=X-Thumbnailer
+Name=TEX Thumbnailer
+TryExec=latex
+TryExec=convert
+MimeType=text/x-tex;
+X-Thumbnailer-Exec=@libexecdir@/tex-thumbnailer %i %o %s




More information about the Goodies-commits mailing list