Using the Mail led with remote mail

I recently switched all my mail reading over to using IMAP over SSL, and needed to get GNOME’s Inbox Monitor applet to handle it. It doesn’t do it natively, so I had to use a script to do the check. It is done easily with fetchmail.

I have found a way to use the extra leds on the Asus M2400N, which I have added to the script.

The script is this:

#!/bin/sh
MBOX=$HOME/.newmail
MLED=/proc/acpi/asus/mled
test -x /usr/bin/fetchmail || exit 0
if fetchmail --ssl -c > $MBOX+; then
    mv -f $MBOX+ $MBOX
    test -w $MLED && echo 1 > $MLED
else
    rm -f $MBOX+ $MBOX
    test -w $MLED && echo 0 > $MLED
fi

In the preferences of GNOME’s Inbox Monitor, the script runs before each update, and the Mail Spool File is set to $HOME/.newmail.

That’s it.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *