aboutsummaryrefslogtreecommitdiffstats
path: root/_mailcap
blob: 0996aecd729a6767ab2524c002aa625805ecd11c (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#
# ~/.mailcap
# Mail MIME configuration file
#
# Reference:
# [1] Gray Johnson's Mutt Page
#     http://www.spocom.com/users/gjohnson/mutt/
#
# Created: 2015-02-02
#


# From the attachment menu, if X is running, HTML attachments are sent
# to netscape for viewing; otherwise, they are sent to w3m.  For
# in-line viewing, the HTML is converted to text.
#
# [Comment-out next line so that we can use w3m even within X.]
#text/html;                      mutt_netscape %s; test=RunningX
text/html;                      w3m -T text/html -I %{charset} -dump %s; \
                                    nametemplate=%s.html;  copiousoutput

# Add capability to edit attachments from the compose menu.
#
# Mutt can only edit attachments if they have a mailcap edit entry.
# (This would be a good thing to fix.)  However, a mailcap entry
# apparently must include the display function--it can't be defaulted.
# The combination "cat; copiousoutput" comes close to the default in
# that in invokes the default pager on the output of cat.  However,
# there is apparently no way to specify the default editor--a shell
# environment variable such as $VISUAL or $EDITOR is as close as we can
# get.
#
text/plain;                     ~/.mutt/mutt_bgrun.sh gvim -f %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
text/plain;                     vim %s
text/*;                         cat; copiousoutput; edit=$EDITOR %s

message/rfc822;	                cat; copiousoutput; edit=$EDITOR %s

# The following Microsoft application MIME attachments are viewed from
# the attachment menu using LibreOffice.
#
application/msword;             ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/msword;             word2text %s; copiousoutput
application/vnd.msword;	        ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/vnd.msword;         word2text %s; copiousoutput
application/vnd.openxmlformats-officedocument.wordprocessingml.document; \
                                ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
#
application/excel;              ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/excel;              excel2text %s; copiousoutput
application/msexcel;            ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/msexcel;            excel2text %s; copiousoutput
application/vnd.ms-excel;       ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/vnd.ms-excel;       excel2text %s; copiousoutput
application/x-excel;            ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/x-excel;            excel2text %s; copiousoutput
application/x-msexcel;          ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/x-msexcel;          excel2text %s; copiousoutput
application/ms-Excel;           ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/ms-Excel;           excel2text %s; copiousoutput
#
application/vnd.ms-powerpoint;  ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/vnd.ms-powerpoint;  ppt2text %s; copiousoutput
application/x-mspowerpoint;     ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/x-mspowerpoint;     ppt2text %s; copiousoutput
application/ppt;                ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/ppt;                ppt2text %s; copiousoutput


application/pdf;                ~/.mutt/mutt_bgrun.sh evince %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/pdf;                pdftotext %s -; copiousoutput

application/postscript;         ~/.mutt/mutt_bgrun.sh evince %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/postscript;         ps2ascii %s; copiousoutput

application/rtf;                ~/.mutt/mutt_bgrun.sh libreoffice %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/rtf;                rtf2text %s; copiousoutput

#application/ms-tnef;            tnef -w %s

#application/octet-stream;       mutt_octet_view -x %s; test=RunningX
#application/octet-stream;       mutt_octet_view -v %s
#application/octet-stream;       mutt_octet_view %s; copiousoutput

image/*;                        ~/.mutt/mutt_bgrun.sh feh %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'

video/*;                        ~/.mutt/mutt_bgrun.sh vlc %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'

# Open scripts
application/x-shellscript;      ~/.mutt/mutt_bgrun.sh gvim -f %s; \
                                    test=sh -c 'test -n "${DISPLAY}"'
application/x-shellscript;      vim %s

# Show archive conents.
#
application/x-compressed-tar;   tar -tf %s; copiousoutput
application/x-bzip-compressed-tar;  \
                                bunzip2 -c %s | tar -tf -; copiousoutput
application/x-tar-gz;           gunzip -c %s | tar -tf -; copiousoutput
application/x-7z-compressed;    7z l %s; copiousoutput

# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=mailcap: #