Hi everybody,
Following the discussion earlier in December I've found a good solution
with 'fetchmail -c' showing the number of new messages in the status bar. The 
code copied from Martin Sander's comment is:

fetchmail -c|sed 's/(//'|awk '{print $1-$3}'
1

The problem is that fetchmail accesses the mail server as often as the
other services in the status bar are accessed - usually every few
seconds, which is unnecessarily often for imap! I've changed it to 60
seconds, which is about the lowest reasonable for the 'date' and 'uptime'. Is
there anything we can do about this?

Here below is the code of the loop in which dwm is started (gratefully copied 
from the list) and .xinitrc :

---
in.sh:

#!/bin/sh -e

        [ $# -eq 1 ]; FIFO="$1"
        [ -e "$FIFO" ] || mkfifo "$FIFO"
        [ -p "$FIFO" ]
        exec >"$FIFO" 2>&1

        while :; do
echo `uptime | sed 's/.*,//'` `date +'%a %d %b %R'` `fetchmail -c --sslproto 
tls |sed 's/(//'|awk '{print $1-$3}'`

sleep 60
        done
        exit 1 # NOTREACHED

--

.xinitrc:

#!/bin/sh
xhkeys
feh --bg-scale /tmp/losung.pnm

WM=dwm
fifo=~/.dwm/in
        
        ~/.dwm/in.sh $fifo &
        while [ ! -p $fifo ]; do sleep .1; done
        
 $WM < $fifo &
        wmpid=$!
        wait $wmpid


-- 
Mit freundlichen Grüssen
P. Vollmar
Dipl. Übersetzer HDS

VOLLMAR ÜBERSETZUNGS-SERVICE
CH-9248 BICHWIL, SWITZERLAND
Tel/Fax:   +41 071 952'77'45
Homepage: www.vollmar.ch
Aktuell:  www.vollmar.ch/download
Computer: www.vollmar.ch/linux

Reply via email to