From adf8e13bb0e722ca6e98d85182b41a47a6e26621 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 13 Sep 2012 10:57:37 +0200 Subject: .config/awesome/rc.lua --- .config/awesome/rc.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to '.config') diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index b602eb7..b544d93 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -54,6 +54,15 @@ function oni.mailcount(account) return i end +function oni.mailcount_text() + return string.format("ryu: %d aet: %d gmail: %d 9f: %d", + oni.mailcount("ryuslash.org"), + oni.mailcount("aethon"), + oni.mailcount("gmail"), + oni.mailcount("ninthfloor")) +end + + -- Returns true if all pairs in table1 are present in table2 function oni.match(table1, table2) for k, v in pairs(table1) do @@ -190,6 +199,16 @@ mytextclock = awful.widget.textclock({ align = "right" }) -- Create a systray mysystray = widget({ type = "systray" }) +-- Create a mailbox widget +mymailbox = widget({ type = "textbox" }) +mymailbox.text = oni.mailcount_text() +mymailboxtimer = timer({ timeout = 60 }) +mymailboxtimer:add_signal("timeout", + function () + mymailbox.text = oni.mailcount_text() + end) +mymailboxtimer:start() + -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} @@ -267,6 +286,7 @@ for s = 1, screen.count() do mylayoutbox[s], mytextclock, s == 1 and mysystray or nil, + s == 1 and mymailbox or nil, mytasklist[s], layout = awful.widget.layout.horizontal.rightleft } -- cgit v1.2.3-54-g00ecf