Re: [dwm] dwm new message notification

From: Antoni Grzymala <antoni_AT_chopin.edu.pl>
Date: Tue, 11 Dec 2007 15:53:20 +0100

Engin Tola dixit (2007-12-11, 14:46):

> I just check the size of the mail file to see if it is non-zero. And
> then I print an 'M' to my status bar like this:
>
> mail_file=/var/mail/tola
> if [ -s $mail_file ]
> then
> mail=M
> else
> mail=''
> fi

I have a background fetchmail (via postfix and procmail) fetching my
e-mails to my maildirs (most of the mail gets into the INBOX, while the
mailing lists (like dwm) are sorted out into specific folders.

Here's the bit of my statusbar script for displaying the number of
unread messages in respective maildirs:

############################################################
# Maildir UNREAD messages (deforked, pure bash version)

for dir in /var/spool/mail/antoni/new/ /home/antoni/mail/*/new/; do
        count=0
        for k in ${dir}/*; do
                [[ -f ${k} ]] && ((count++))
        done

        if [[ ${count} -ne 0 ]]; then
                dir=${dir/\/var\/spool\/mail\/antoni\/new\//Spool}
                dir=${dir/\/home\/antoni\/mail\//}
                dir=${dir/\/new\//}
                MAIL="${dir}: ${count} ยท ${MAIL}"
        fi
done

############################################################

Best,

-- 
[a]

Received on Tue Dec 11 2007 - 15:53:28 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:11:21 UTC