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

audio/mpeg; /usr/bin/id3v2 -l %s; copiousoutput; test=[ -z "$LYNX_VERSION" ]

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/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/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/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; test=[ -z "$LYNX_VERSION" ]

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

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

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/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 -eval 'set document.codepage.assume = "%{charset}"' %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/rtf; /usr/bin/unrtf --nopict --text --quiet %s; copiousoutput; test=[ -z "$LYNX_VERSION" ]

application/vnd.oasis.opendocument.presentation;odt2txt %s; copiousoutput; test=[ -z "$LYNX_VERSION" -a -z "$DISPLAY" ]
application/vnd.oasis.opendocument.spreadsheet; odt2txt %s; copiousoutput; test=[ -z "$LYNX_VERSION" -a -z "$DISPLAY" ]
application/vnd.oasis.opendocument.text;	odt2txt %s; copiousoutput; test=[ -z "$LYNX_VERSION" -a -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/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; test=[ -z "$LYNX_VERSION" ]

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/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; test=[ -z "$LYNX_VERSION" ]

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/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; test=[ -z "$LYNX_VERSION" ]

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/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; test=[ -z "$LYNX_VERSION" ]

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