# mailcap

# html
text/plain; v %s
text/html; open %s; nametemplate=%s.html; needsterminal
text/html; html2text --pad-tables --images-to-alt --reference-links --ignore-mailto-links --no-wrap-links %s %{charset}; copiousoutput; test=test -n "$EDITOR"
## lynx | allows mutt to decode text/html attachments and display them inline.
text/html; lynx -dump -display_charset=utf-8 %s; copiousoutput; nametemplate=%s.html
# allows mutt to decode text/html attachments and display them inline.
text/html; lynx -dump -assume_charset=%{charset} -display_charset=utf-8 %s; copiousoutput; nametemplate=%s.html
# text/html; lynx -dump -assume_charset=%{charset} -display_charset=utf-8 %s; copiousoutput; nametemplate=%s.html
# text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput;
# text/html; openfile %s; nametemplate=%s.html
## w3m
# text/html; w3m -I %{charset} -O utf-8 -T text/html -o pseudo_inlines=0 -o display_link_number=1; copiousoutput
# text/html; w3m -I %{charset} -T text/html; copiousoutput;
# text/html; w3m -dump -T text/html %s; needsterminal; copiousoutput;
# text/html; w3m %s; nametemplate=%s.html; needsterminal
# text/html; w3m -v -F -T text/html -dump %s; copiousoutput
# text/csv; sc-im "%s"; edit=sc-im "%s"; compose=sc-im "%s"; description="CSV Document"; nametemplate=%s.csv
text/x-diff; colordiff; copiousoutput
text/x-patch; colordiff; copiousoutput
text/*; v '%s'; needsterminal; print=bat '%s';

# calendar
# text/calendar; sed 's/^METHOD:REQUEST$/METHOD:PUBLISH/' %s > %s.tmp && mv %s.tmp %s && open %s; nametemplate=%s.ics; needsterminal
# text/calendar; mutt-ics; copiousoutput
# application/ics; mutt-ics; copiousoutput

# media
## images
image/*; chafa "%s" ;
image/jpeg; /usr/bin/xdg-open %s
# image/*; open %s ; copiousoutput
# image/bmp;chafa %s
# image/gif;chafa %s
# image/libm;chafa %s
# image/jpg;chafa %s
# image/jpeg;chafa %s
# image/png;chafa %s
# image/tiff;chafa %s
# image/x-png;chafa %s
# image/*; openfile %s ;
## video | mpv
# video/*; mpv '%s'; print=mpv --aid=no --vid=no --sid=no '%s' || : ;
# video/*; mpv --quiet %s &; copiousoutput
video/*; mpv %s;
## audio | mpv
audio/*; mpv --player-operation-mode=pseudo-gui %s
# audio/*; mpv '%s'; print=mpv --aid=no --vid=no --sid=no '%s' || : ;
# audio/mpeg; mpv '%s'; print=mpv --aid=no --vid=no --sid=no '%s' || : ;
# audio/*; mpv %s ;

# pdf
application/*; open %s ;
# application/pdf; openfile %s ;
# application/pdf; /usr/local/bin/zathura %s pdf

# encryped
application/pgp-encrypted; gpg -d '%s'; copiousoutput;
application/pgp-keys; gpg --import '%s'; copiousoutput;

# open these MIME types in external program
# application/*; open %s; needsterminal
# image/*; open %s; needsterminal
# audio/*; open %s; needsterminal
