Check for new mail in a mbox

A simple an easy to understand widget for Awesome 3.x which display in a textbox widget the amount of mails in the mbox.

This it's an useful widget if you use fetchmail as I do =)

mailbox = widget({type = "textbox", align = "right" }) mailbox.text = "Mail 0" mailbox_timer = timer({ timeout = 15 }) mailbox_timer:add_signal("timeout", function                                      local mfile = io.popen( "python -c \"import mailbox\nprint len(mailbox.mbox(\'/var/mail/zeus/\'))\"", "r")                                       mailbox.text = "Mail "..mfile:read("*a")                                    end                      ) mailbox_timer:start

Then it just must be added to your wibox =).

As you can see you can modified to check maildir or any other type of mail container supported by Python.

You should install python which it comes with most the popular distribution by default.