]> gitweb.michael.orlitzky.com - mutt.git/commitdiff
mailcap-epiphany: add mailcap file that text/html via Epiphany.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 25 Aug 2021 20:00:22 +0000 (16:00 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 25 Aug 2021 20:00:22 +0000 (16:00 -0400)
Using the Epiphany browser to read HTML attachments is not as easy as
you'd think. Here we add a special mailcap file that manages it. To
Use it, symlink it to ~/.mailcap or something like that.

mailcap-epiphany [new file with mode: 0644]

diff --git a/mailcap-epiphany b/mailcap-epiphany
new file mode 100644 (file)
index 0000000..11c4c9a
--- /dev/null
@@ -0,0 +1,9 @@
+# We avoid using "nametemplate" because it uses a predictable filename
+# under /tmp. The "needsterminal" forces mutt to wait until you press
+# Return before it deletes the file; otherwise, Epiphany will notice
+# that it's gone and show you nothing. Finally, the call to "tidy"
+# ensures that Epiphany will not balk at the invalid HTML prevalent in
+# emails. We ignore errors in "tidy" because we expect a bunch of HTML
+# warnings to remain. The weird subshell construct is there because I
+# don't know how to escape a semicolon.
+text/html; (tidy -quiet -modify %s || true) && /usr/bin/epiphany %s; description=HTML Text; test=test -n "$DISPLAY"; needsterminal;