Check for new mail in a maildir folder
From awesome
A simple widget for Awesome 3.x that checks for new mail in a maildir folder. Requires the Lua Filesystem Library and is currently designed to be used with Wicked.
Download: github.com/dmj
Usage
rc.lua:
require("mailcheck")
[...]
widgets.mail = widget({ type = "textbox", align = "right", name = "mail", width = 100 })
mailcheck.register( widgets.mail, settings.env.home .. "/Mail", "black", "darkgreen" )
wicked.register(widgets.mail, mailcheck.check, " mail: $1 ")
[...]
mailcheck.register takes two mandatory and two optional parameters:
- the textbox widget itself (mandatory)
- the maildir folder to check (mandatory)
- the widget's background color if mailbox is empty (optional, defaults to "black")
- the widget's background color if there are new messages (optional, defaults to "darkgreen")
mailcheck.check() returns the number of new messages and sets the widget's background accordingly