Skip to content

Instantly share code, notes, and snippets.

@canabady
Created December 27, 2019 05:19
Show Gist options
  • Save canabady/3cc1182033f2b569322bc5b09635fd71 to your computer and use it in GitHub Desktop.
Save canabady/3cc1182033f2b569322bc5b09635fd71 to your computer and use it in GitHub Desktop.
# Every time an attempt to open an attachment is made, it's copied in a dedicated temp directory and the copy is opened.
# application/*; mkdir -p /tmp/mutt \; cp %s /tmp/mutt \; xdg-open /tmp/mutt/$(basename %s) &
##############################################################################
#
# MIME types and programs that process those types
#
###############################################################################
application/vnd.openxmlformats-officedocument.wordprocessingml.document; /usr/bin/abiword '%s'; test=test -n "$DISPLAY"
application/pdf; /usr/bin/xpdf -fullscreen '%s'; test=test -n "$DISPLAY"
# application/pdf; /usr/bin/xpdf -fullscreen -fitwidth '%s'; test=test -n "$DISPLAY"
image/*; /usr/bin/feh -F '%s'; test=test -n "$DISPLAY"
# image/*; /usr/bin/gthumb '%s'; test=test -n "$DISPLAY"
# The first of those two entries will be used for viewing the message in an external program (in this case Firefox). The second entry will be invoked by Mutt's auto_view to render the message and display it in plaintext. I'm using elinks here, but other text web browsers are capable of performing the same "dump" action as well.
text/html; ~/bin/html2pdf-view.sh %s; nametemplate=%s.html
# text/html; /usr/bin/firefox %s; nametemplate=%s.html; needsterminal
# text/html; /usr/bin/min %s >/dev/null 2>&1; copiousoutput
text/html; elinks -dump %s; nametemplate=%s.html copiousoutput; description=HTML Text
# multipart/alternative; /usr/bin/firefox %s >/dev/null 2>&1; needsterminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment