image/*; /usr/bin/eog %s; test=[ -n "$DISPLAY" -a -x /usr/bin/eog ]
image/*; /usr/bin/qiv %s; test=[ -n "$DISPLAY" ]
image/*; /usr/bin/asciiview %s; test=[ -z "$DISPLAY" ]
image/*; /usr/bin/cacaview %s; test=[ -z "$DISPLAY" ]
image/*; /usr/bin/identify -verbose %s; copiousoutput

audio/mpeg; /usr/bin/id3v2 -l %s; copiousoutput

audio/mod; /usr/bin/mikmod %s

# play is apparently a security hole
#audio/*; /usr/bin/play %s
audio/*; /usr/bin/mplayer -vc null -vo null %s; test=[ -z "$DISPLAY" ]
audio/*; /usr/X11R6/bin/xterm -name mplayer -e /usr/bin/mplayer -vc null -vo null %s & /bin/sleep 1; test=[ -n "$DISPLAY" ]

video/*; /usr/bin/mplayer -vc null -vo null %s; test=[ -z "$DISPLAY" ]
video/*; /usr/X11R6/bin/xterm -name mplayer -e /usr/bin/mplayer %s & /bin/sleep 1; test=[ -n "$DISPLAY" ]

video/mpeg; /usr/bin/mplayer -vc null -vo null %s; test=[ -z "$DISPLAY" ]
video/mpeg; /usr/X11R6/bin/xterm -name mplayer -e /usr/bin/mplayer %s & /bin/sleep 1; test=[ -n "$DISPLAY" ]

application/pdf; /usr/bin/xpdf %s; test=[ -n "$DISPLAY" ]
application/pdf; /usr/bin/pdftotext -layout -nopgbrk %s -; copiousoutput

application/postscript; /usr/bin/gv -safer %s; test=[ -n "$DISPLAY" ]
application/postscript; /usr/bin/ps2ascii %s; copiousoutput

application/x-dvi; /usr/bin/xdvi %s; test=[ -n "$DISPLAY" ]
application/x-dvi; /usr/bin/dvi2tty -w123 %s; copiousoutput

text/html; /usr/bin/htmlview %s; copiousoutput; test=[ -x /usr/bin/htmlview ]
text/html; /usr/bin/elinks %s; nametemplate=%s.html; test=[ -z "$DISPLAY" ]
text/html; /usr/X11R6/bin/xterm -name xterm-elinks -e /usr/bin/elinks %s & /bin/sleep 1; nametemplate=%s.html; test=[ -n "$DISPLAY" ]
text/html; /usr/bin/elinks -dump %s; copiousoutput

#text/x-patch; /usr/bin/colordiff.pl < %s | less -r

application/x-shockwave-flash; /usr/bin/swfplayer %s & sleep 2; test=[ -n "$DISPLAY" ]

application/vnd.oasis.opendocument.presentation; odt2txt %s; copiousoutput; test=[ -z "$DISPLAY" ]
application/vnd.oasis.opendocument.spreadsheet; odt2txt %s; copiousoutput; test=[ -z "$DISPLAY" ]
application/vnd.oasis.opendocument.text; odt2txt %s; copiousoutput; test=[ -z "$DISPLAY" ]

application/vnd.sun.xml.writer; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	cd "$tmp"\; /usr/bin/soffice2html.pl %s\; \
	/usr/bin/elinks content.html\; \
	/bin/rm -rf "$tmp"; test=[ -z "$DISPLAY" ]

application/vnd.sun.xml.writer; /usr/bin/oowriter %s; test=[ -n "$DISPLAY" -a -x /usr/bin/oowriter ]

application/vnd.sun.xml.writer; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	cd "$tmp"\; /usr/bin/soffice2html.pl %s\; \
	{ /usr/X11R6/bin/xterm -name xterm-elinks -e /usr/bin/elinks content.html\; \
	/bin/rm -rf "$tmp"\;} &; test=[ -n "$DISPLAY" ]

application/vnd.sun.xml.writer; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	cd "$tmp"\; /usr/bin/soffice2html.pl %s\; \
	/usr/bin/elinks -dump content.html\; \
	/bin/rm -rf "$tmp"; copiousoutput

application/msword; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	/usr/bin/wvHtml %s --targetdir="$tmp" page.html -1\; \
	/usr/bin/elinks "$tmp/page.html"\; \
	/bin/rm -rf "$tmp"; test=[ -z "$DISPLAY" ]

application/msword; /usr/bin/oowriter %s; test=[ -n "$DISPLAY" -a -x /usr/bin/oowriter ]

application/msword; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	/usr/bin/wvHtml %s --targetdir="$tmp" page.html\; \
	{ /usr/X11R6/bin/xterm -name xterm-elinks -e /usr/bin/elinks "$tmp/page.html"\; \
	/bin/rm -rf "$tmp"\;} &; test=[ -n "$DISPLAY" ]

application/msword; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	/usr/bin/wvHtml %s --targetdir="$tmp" page.html -1\; \
	/usr/bin/elinks -dump "$tmp/page.html"\; \
	/bin/rm -rf "$tmp"; copiousoutput

application/vnd.ms-excel; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	/usr/bin/xlhtml -a %s > "$tmp/page.html"\; \
	/usr/bin/elinks "$tmp/page.html"\; \
	/bin/rm -rf "$tmp"; test=[ -z "$DISPLAY" ]

application/vnd.ms-excel; /usr/bin/oocalc %s; test=[ -n "$DISPLAY" -a -x /usr/bin/oocalc ]

application/vnd.ms-excel; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	/usr/bin/xlhtml -a %s > "$tmp/page.html"\; \
	{ /usr/X11R6/bin/xterm -name xterm-elinks -e /usr/bin/elinks "$tmp/page.html"\; \
	/bin/rm -rf "$tmp"\;} &; test=[ -n "$DISPLAY" ]

application/vnd.ms-excel; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	/usr/bin/xlhtml -a %s > "$tmp/page.html"\; \
	/usr/bin/elinks -dump "$tmp/page.html"\; \
	/bin/rm -rf "$tmp"; copiousoutput

application/vnd.ms-powerpoint; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	/usr/bin/ppthtml %s > "$tmp/page.html"\; \
	/usr/bin/elinks "$tmp/page.html"\; \
	/bin/rm -rf "$tmp"; test=[ -z "$DISPLAY" ]

application/vnd.ms-powerpoint; /usr/bin/ooimpress %s; test=[ -n "$DISPLAY" -a -x /usr/bin/ooimpress ]

application/vnd.ms-powerpoint; tmp=`/bin/mktemp -d %s.XXXXXX`\; \
	/usr/bin/ppthtml %s > "$tmp/page.html"\; \
	{ /usr/X11R6/bin/xterm -name xterm-elinks -e /usr/bin/elinks "$tmp/page.html"\; \
	/bin/rm -rf "$tmp"\;} &; test=[ -n "$DISPLAY" ]

application/vnd.ms-powerpoint; tmp=`/bin/mktemp %s.XXXXXX`\; \
	/usr/bin/ppthtml %s > "$tmp"\; \
	/usr/bin/elinks -dump "$tmp"\; \
	/bin/rm -f "$tmp"; copiousoutput

application/x-bzip-compressed-tar; /bin/tar jtvvf %s; copiousoutput
application/x-tar; /bin/tar tvvf %s; copiousoutput
application/x-tgz; /bin/tar ztvvf %s; copiousoutput
application/x-rar-compressed; /usr/bin/unrar v -c- %s; copiousoutput
application/x-zip-compressed; /usr/bin/unzip -v %s; copiousoutput
application/zip; /usr/bin/unzip -v %s; copiousoutput
application/x-rpm; /bin/rpm -qpilv %s; copiousoutput
application/ms-tnef; /usr/bin/tnef -vt %s; copiousoutput
application/pgp-encrypted; /usr/bin/gpg -vv %s 2>&1; copiousoutput
application/pgp-signature; /usr/bin/gpg -vv %s 2>&1; copiousoutput
