[Mutt] pretty-print mutt emails
Globe Trotter
itsme_410 at yahoo.com
Mon Nov 22 14:32:09 UTC 2021
Thanks!
> On Monday, November 22, 2021, 08:19:52 AM CST, Mihai Lazarescu <mtlagm at gmail.com> wrote:
> I use without problems muttprint 0.73 in Fedora from within a wrapper script, which removes spamassassin markings, converts to PDF using ps2pdf, and finally opens it with xdg-open for checking and printing using the regular dialog.
> Mihai
This works when used with this script that I found on stackoverlow (I think). I have not tried the other scripts but presumably they work too.
!/bin/bash
read tmpdir < <(mktemp -d /tmp/print_preview-$USER-XXXXXXXX)
cd $tmpdir || exit 1
trap "cd && rm -fR $tmpdir;exit" 0 1 2 3 6 9 15
cat >file.eml
muttprint -P A4 -p TO_FILE:file.ps <file.eml
read numPages < <(sed '/^%%Pages/{s/%%Pages: //;q;};d' file.ps)
(( numPages > 1 )) &&
muttprint -2 -P A4 -p TO_FILE:file.ps <file.eml
zathura file.ps
I wonder if I can get a dialog that gives me a choice of 1 or 2 pages printing. Perhaps I have two scripts for that?
I like it, it is pretty nice.
Thanks again!
More information about the Mutt-users
mailing list