summaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-09-15 14:28:45 +0200
committerGravatar Tom Willemsen2012-09-15 14:28:45 +0200
commitbbc17210a1d3b0c69c36207891d9fb18fd8759f9 (patch)
tree6bc6296555ff336addb56beac2b7b81cb435fc83 /.config
parent1c3aacb1400d2d1e6ec3318716e02c38432cee59 (diff)
downloaddotfiles-bbc17210a1d3b0c69c36207891d9fb18fd8759f9.tar.gz
dotfiles-bbc17210a1d3b0c69c36207891d9fb18fd8759f9.zip
.config/awesome/rc.lua
Diffstat (limited to '.config')
-rw-r--r--.config/awesome/rc.lua44
1 files changed, 37 insertions, 7 deletions
diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua
index 0cc96ae..e3d4548 100644
--- a/.config/awesome/rc.lua
+++ b/.config/awesome/rc.lua
@@ -62,6 +62,22 @@ function oni.mailcount_text()
oni.mailcount("ninthfloor"))
end
+function oni.mailcount_widgets(label, account, name)
+ widgets = {}
+ widgets.label = widget({ type = "textbox" })
+ widgets.label.text = string.format(" %s: ", label)
+ widgets.count = widget({ type = "textbox" })
+ widgets.count.text = string.format(" %d ", oni.mailcount(account))
+ widgets.count.bg = beautiful.bg_focus
+ widgets.count:buttons(
+ awful.util.table.join(
+ awful.button({ }, 1,
+ function (c)
+ awful.util.spawn("emacsclient -e '(oni:view-mail \"" .. name .. "\")'")
+ end)))
+
+ return widgets
+end
-- Returns true if all pairs in table1 are present in table2
function oni.match(table1, table2)
@@ -199,13 +215,20 @@ mytextclock = awful.widget.textclock({ align = "right" })
mysystray = widget({ type = "systray" })
-- Create a mailbox widget
-mymailbox = widget({ type = "textbox" })
-mymailbox.text = oni.mailcount_text()
+myryumailbox = oni.mailcount_widgets("ryu", "ryuslash.org", "ryuslash")
+myaethonmailbox = oni.mailcount_widgets("aet", "aethon", "aethon")
+mygmailmailbox = oni.mailcount_widgets("gmail", "gmail", "gmail")
+my9fmailbox = oni.mailcount_widgets("9f", "ninthfloor", "ninthfloor")
+
mymailboxtimer = timer({ timeout = 60 })
-mymailboxtimer:add_signal("timeout",
- function ()
- mymailbox.text = oni.mailcount_text()
- end)
+mymailboxtimer:add_signal(
+ "timeout",
+ function ()
+ myryumailbox.count.text = string.format(" %d ", oni.mailcount("ryuslash.org"))
+ myaethonmailbox.count.text = string.format(" %d ", oni.mailcount("aethon"))
+ mygmailmailbox.count.text = string.format(" %d ", oni.mailcount("gmail"))
+ my9fmailbox.count.text = string.format(" %d ", oni.mailcount("ninthfloor"))
+ end)
mymailboxtimer:start()
-- Create a wibox for each screen and add it
@@ -285,7 +308,14 @@ for s = 1, screen.count() do
mylayoutbox[s],
mytextclock,
s == 1 and mysystray or nil,
- s == 1 and mymailbox or nil,
+ s == 1 and my9fmailbox.count or nil,
+ s == 1 and my9fmailbox.label or nil,
+ s == 1 and mygmailmailbox.count or nil,
+ s == 1 and mygmailmailbox.label or nil,
+ s == 1 and myaethonmailbox.count or nil,
+ s == 1 and myaethonmailbox.label or nil,
+ s == 1 and myryumailbox.count or nil,
+ s == 1 and myryumailbox.label or nil,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft
}