On Wed, Jan 09, 2008 at 11:05:49PM +0100, Peter Vollmar wrote:
> 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
Hi,
I have a slightly different approach to get notified about emails (sorry, but
I haven't read the former thread). On my machine fetchmail is started via crond
and I have written a script which queries the maildirs and prints the new mails
to stdout. This is then read by my .xinitrc . Just in case you are interested, I
have attached the scripts.
If someone knows some improvements, please don't hesitate to tell me.
bye
richi
-- quoting guide: http://www.xs4all.nl/~hanb/documents/quotingguide.html
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:15:23 UTC