Re: [dwm] dwm new message notification

From: Jeremy O'Brien <obrien654j_AT_gmail.com>
Date: Tue, 11 Dec 2007 12:37:33 -0500

On Tue, Dec 11, 2007 at 03:53:20PM +0100, Antoni Grzymala wrote:
> 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]

Haha. You gave me this script before, and it was the one that I was
previously using. Worked like a charm! Unfortunately, IMAP works
differently and doesn't populate my ~/.maildir directory anymore :(
Thank you though! :)

-- 
Jeremy O'Brien aka neutral_insomniac
GPG key: 0xB1140FDB http://pohl.ececs.uc.edu/~jeremy/jeremy.asc
Linux ambelina 2.6.22.9 #1 Zilog(R) Z80
processor 4MHz GNU/Linux

Received on Tue Dec 11 2007 - 18:37:11 UTC

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