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