[plug] Kmail
Bernard Blackham
bernard at blackham.com.au
Mon Feb 25 16:22:11 WST 2002
On Mon, Feb 25, 2002 at 12:36:51PM +0800, garry wrote:
> A quick solution.. Might help till you work out The Way(TM)..
>
> Make up a text file, make it executable. Tell kmail to execute it on receipt
> of mail.. Quickest way, here's how I made a test up a moment ago..
This is my quick and dirty solution I whipped up. Displays the last
Subject line and last From line in your mail file. But this doesnt
always match up. Spurious subject lines from forwards, or the
complete absence of a subject line etc etc stuff it up. But it works
for me most of the time. It also uses different colours and
different sounds for direct messages (you'll need to change that fo
you). And there are probably better solutions out there, but this is
here for the taking!
#!/bin/sh
#
#
tome=0
subject=`grep "^Subject: " $MAIL|tail -1|cut -f 2- -d " "`
from=`grep "^From: " $MAIL|tail -1|cut -f 2- -d " "`
grep "^To: " $MAIL|tail -1|cut -f 2- -d " "|grep -q bernard && tome=1
# change this to what appears in your To: line ^^^^^^^
# (doesnt handle multiline To: lines where your address isnt on the
# first line.
# unimportant colours
fgcolor="black"
timeout=5
# if to me, set important colours
[ $tome -eq 1 ] && fgcolor="red" && timeout=3
xmessage -xrm *.font:*-helvetica-*-*-*-*-14-* -xrm *.borderWidth:0 -xrm *.geometry:-0+0 -xrm *.title:"You have new mail" -xrm *.foreground:"$fgcolor" -buttons "" -timeout $timeout $from regarding $subject &
# sing a nice tune
tune="200 300 400 200 300 400"
[ $tome -eq 1 ] && tune="200 300 400 500 600 700 800"
for i in $tune ; do beep -f $i -l 50 ; done
--- end of file.
It's ugly hey.
Enjoy.
B.
--
Bernard Blackham
bernard at blackham.com.au
More information about the plug
mailing list