-
Notifications
You must be signed in to change notification settings - Fork 4
/
mailcap
35 lines (32 loc) · 1.86 KB
/
mailcap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# When using the <view-attach> or <view-mailcap> functions (return key and "m" key in the
# attachment menu) for an HTML attachment:
# * display the HTML file in a new tab in Firefox if X is running ([1] explains why we
# need `sleep`),
# * display the HTML file using Lynx otherwise.
#
# TODO: Use [surf](https://surf.suckless.org) instead of Firefox? Block external
# resources?
#
# The second entry will also be used for automatically viewing the HTML attachment while
# in the pager [2] because "when using the built-in pager, only entries with [the
# copiousoutput] flag will be considered a handler for a MIME type" [3]. "Entries with
# the copiousoutput tag should always be specified as the last one per type" [4].
#
# [1]: https://dev.mutt.org/trac/wiki/MuttFaq/Attachment#HowtoviewHTMLattachmentsinanewtabinfirefox:
# [2]: https://dev.mutt.org/doc/manual.html#auto-view
# [3]: https://dev.mutt.org/doc/manual.html#optional-mailcap-fields
# [4]: https://dev.mutt.org/doc/manual.html#mailcap-search-order
text/html; "$BROWSER" %s && sleep 3; test=test -n "$DISPLAY"
text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput
image/*; feh -B black --scale-down %s; test=test -n "$DISPLAY"
video/*; mpv --keep-open -
# Use stdin because it allows us to fork (NeoMutt would shred the file if we were to use
# %s). See <file:///usr/share/doc/neomutt/manual.html#mailcap-basics>.
application/pdf; zathura --fork - && sleep 1; test=test -n "$DISPLAY"
application/pdf; pdftotext %s -; copiousoutput;
application/vnd.oasis.opendocument.text; lowriter %s
application/msword; lowriter %s
application/vnd.openxmlformats-officedocument.wordprocessingml.document; lowriter %s
application/vnd.oasis.opendocument.spreadsheet; localc %s
application/vnd.ms-excel; localc %s
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; localc %s