On Mon, Jul 12, 2010 at 01:53:26PM +0200, Andreas Kalex wrote:
> Hi,
>
> I'm using muttprint to print my mails. I have two printers, normally I use a
> HP 690C to print
> them, but sometimes i want to print on the other.
> So I changed the shell, edit .muttprintrc and set/delete the comment sign
> were it is needed.
> PRINTER="HP-Deskjet-690c"
> # PRINTER="Samsung-CLP-510"
> or vice versa.
>
> Is there a way to do it interactiv, or with a macro for each printer?
You could use a script to wrap muttprint:
.muttprintrc:
...
PRINTER="TO_FILE:/home/pincopallino/mail.ps"
...
~/bin/printmail:
#!/bin/sh
muttprint "$@"
PRINTER=$(cat ~/.printer)
lpr -P "$PRINTER" ~/mail.ps
Now every time you need to change you printer, just write to ~/.printer
the name of the new printer:
echo "HP-Deskjet-690c" > ~/.printer
# echo "Samsung-CLP-510" > ~/.printer
Hypothetically you can do that ~/.printer file change automatically, with
the help of udev.
Not tested.
m.
--
Lo punite del fatto che la sua infanzia ha strisciato sul suolo senza
stelo e senza tutore; gli imputate come un misfatto l'isolamento in cui
lo avete lasciato; della sua sventura fate il suo delitto! Nessuno gli
ha insegnato a sapere ciò che faceva: quest'uomo ignora. La sua colpa
appartiene al suo destino, non a lui. Voi colpite un innocente.
-- Victor Hugo