Update wibox widgets

This commit is contained in:
Tom Willemse 2015-04-08 15:14:19 +02:00
parent fb1066f5e0
commit 9dcc9e0ca5

View file

@ -241,32 +241,56 @@ myrsslist.set_count = function (self, count)
end
end
function mailcount()
mailboxes = { 'ryuslash.org', 'picturefix', 'gmail', 'ninthfloor' }
count = 0
for i, box in ipairs(mailboxes) do
count = count + new_mail(box .. '/inbox')
end
return count
end
mymailwidget = wibox.widget.textbox()
mymailwidget.set_count = function (self)
count = mailcount()
if count then
self:set_markup(" " .. count
.. " <span face=\"FontAwesome\"></span>")
else
self:set_text("")
end
end
mymailwidget:set_count()
function unlocked()
if awful.util.pread("gkeyring -1 --name unlocked") == "true" then
if awful.util.pread("keycheck login") == "Unlocked" then
return ""
else
return ""
end
end
-- mykeyringlist = wibox.widget.textbox()
-- mykeyringlist:set_text(unlocked())
-- mykeyringlist:set_font("FontAwesome")
-- mykeyringlist:buttons(
-- awful.util.table.join(
-- awful.button({ }, 2, function ()
-- mykeyringlist:set_text(unlocked())
-- end)
-- )
-- )
-- mykeyringlisttimer = timer({ timeout = 60 })
-- mykeyringlisttimer:connect_signal(
-- "timeout",
-- function ()
-- mykeyringlist:set_text(unlocked())
-- end
-- )
-- mykeyringlisttimer:start()
mykeyringlist = wibox.widget.textbox()
mykeyringlist:set_text(unlocked())
mykeyringlist:set_font("FontAwesome")
mykeyringlist:buttons(
awful.util.table.join(
awful.button({ }, 2, function ()
mykeyringlist:set_text(unlocked())
end)
)
)
mykeyringlisttimer = timer({ timeout = 60 })
mykeyringlisttimer:connect_signal(
"timeout",
function ()
mykeyringlist:set_text(unlocked())
end
)
mykeyringlisttimer:start()
for s = 1, screen.count() do
-- Create a promptbox for each screen
@ -300,13 +324,14 @@ for s = 1, screen.count() do
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.horizontal()
if s == 1 then
right_layout:add(mykeyringlist)
if avandu then right_layout:add(myrsslist) end
right_layout:add(mymailwidget)
for k, w in pairs(mailwidgets) do
right_layout:add(w)
end
-- for k, w in pairs(mailwidgets) do
-- right_layout:add(w)
-- end
-- right_layout:add(mykeyringlist)
right_layout:add(wibox.widget.systray())
end
right_layout:add(mytextclock)