From 7a7b4a309629ac2f401816ab044ee3ece34bf130 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 2 May 2023 13:47:18 -0300 Subject: Feat: initial printing support --- muttrc.dot.link | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'muttrc.dot.link') diff --git a/muttrc.dot.link b/muttrc.dot.link index 9af1163..2a976ca 100644 --- a/muttrc.dot.link +++ b/muttrc.dot.link @@ -37,10 +37,41 @@ set charset = "utf-8" # ---------------------- # OS Specifiques options # ---------------------- -set print = ask-no set ispell="aspell -e -c --lang=pt_BR" set spoolfile = "~/mail/INBOX" +# -------- +# Printing +# -------- + +# Disable printing entirely +#bind index p noop +#bind pager p noop +#bind pager P noop + +# Always ask for confirmation +set print = ask-no + +# Muttprint +# See https://unix.stackexchange.com/questions/20456/pretty-print-mails-from-mutt +# https://muttprint.sourceforge.net/ +# +# Display the PDF after printing it +#set print_command='set -e; mkdir -p "$HOME"/.cache/mutt; f=`mktemp -p "$HOME"/.cache/mutt`; \ +# muttprint -P A4 -p TO_FILE:"$f"; zathura "$f"; rm "$f"' +# +# Simply produce the PDF +# Needs additional tuning on the mutt firejail profile in order to work +#set print_command='set -e; mkdir -p "$HOME"/.cache/mutt; f=`mktemp -p "$HOME"/.cache/mutt muttprint.XXXX.ps`; \ +# muttprint -P A4 -p TO_FILE:"$f"; ps2pdf "$f"; echo Saved output into `basename "$f" .ps`.pdf' + +# Simply output the message to a file +set print_command='set -e; mkdir -p "$HOME"/.cache/mutt; f=`mktemp -p "$HOME"/.cache/mutt muttprint.XXXX.txt`; \ + cat - > "$f"; echo Saved output into "$f" \ + echo You convert it to a PDF using the following command: ; \ + echo "" ; \ + echo "cat $f | muttprint -P A4 -p TO_FILE:$f.ps ; ps2pdf $f.ps"' + # ---------- # Menu index # ---------- @@ -323,13 +354,6 @@ macro pager X "unset wait_key\nbogofilter -MNs\nunset wait_key\nbogofilter -n\n" "Learn as ham and save" macro pager H "unset wait_key\nbogofilter -n\n" "Learn as ham and save" -# ---------------- -# Disable printing -# ---------------- -bind index p noop -bind pager p noop -bind pager P noop - # ---------------------------------------------------------------- # Schleuder config # -- cgit v1.2.3