diff options
author | Robin Jarry <robin@jarry.cc> | 2022-10-13 00:03:42 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-16 11:35:24 +0200 |
commit | ebfd2a9da3d63390a9d4a0c227b2513a0dac19a4 (patch) | |
tree | edae511a998f7d3a0427649342294ecaf09f5454 /config/aerc.conf | |
parent | 9bd2e0c84fef66007bcab027883c01414b99b77c (diff) | |
download | aerc-ebfd2a9da3d63390a9d4a0c227b2513a0dac19a4.tar.gz |
filters: export mime type and filename in env
Export AERC_MIME_TYPE and AERC_FILENAME in the filters command
environment. This allows dynamic coloring with tools that require
a filename and/or a mime type to determine the syntax.
Update docs and add example use in the default config file.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'config/aerc.conf')
-rw-r--r-- | config/aerc.conf | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/config/aerc.conf b/config/aerc.conf index 66aae825..a980c70e 100644 --- a/config/aerc.conf +++ b/config/aerc.conf @@ -310,6 +310,11 @@ reply-to-self=true # $PREFIX/share/aerc/filters # /usr/share/aerc/filters # +# The following variables are defined in the filter command environment: +# +# AERC_MIME_TYPE the part MIME type/subtype +# AERC_FILENAME the attachment filename (if any) +# # The first filter which matches the email's mimetype will be used, so order # them from most to least specific. # @@ -323,6 +328,7 @@ message/delivery-status=colorize message/rfc822=colorize #text/html=pandoc -f html -t plain | colorize #text/html=html | colorize +#text/*=bat -fP --file-name="$AERC_FILENAME" #application/x-sh=bat -fP -l sh #image/*=catimg -w $(tput cols) - #subject,~Git(hub|lab)=lolcat -f |