Use passive widgets
This way awesome won't block when trying to get something and it takes a long time (like getting number of unread RSS articles without an internet connection).
This commit is contained in:
parent
cebd95b07a
commit
7b7ebbbc7c
1 changed files with 28 additions and 31 deletions
|
@ -203,37 +203,30 @@ mytasklist.buttons = awful.util.table.join(
|
||||||
if client.focus then client.focus:raise() end
|
if client.focus then client.focus:raise() end
|
||||||
end))
|
end))
|
||||||
|
|
||||||
mymaillist = wibox.widget.textbox()
|
function mailwidget(name, lighter)
|
||||||
mymaillist:set_text(
|
widget = wibox.widget.textbox()
|
||||||
string.format(" ryu: %d pfx: %d gmail: %d 9f: %d ",
|
widget.set_mailcount = function (self)
|
||||||
new_mail('ryuslash.org/inbox'),
|
self:set_text(string.format(" %s: %d", lighter,
|
||||||
new_mail('picturefix/inbox'),
|
new_mail(name .. '/inbox')))
|
||||||
new_mail('gmail/inbox'),
|
end
|
||||||
new_mail('ninthfloor/inbox')))
|
widget:set_mailcount()
|
||||||
mymaillisttimer = timer({ timeout = 60 })
|
|
||||||
mymaillisttimer:connect_signal(
|
return widget
|
||||||
"timeout",
|
end
|
||||||
function ()
|
|
||||||
mymaillist:set_text(
|
mailwidgets = {ryuslash = mailwidget('ryuslash.org', 'ryu'),
|
||||||
string.format(" ryu: %d pfx: %d gmail: %d 9f: %d ",
|
picturefix = mailwidget('picturefix', 'pfx'),
|
||||||
new_mail('ryuslash.org/inbox'),
|
gmail = mailwidget('gmail', 'gmail'),
|
||||||
new_mail('picturefix/inbox'),
|
ninthfloor = mailwidget('ninthfloor', '9f')}
|
||||||
new_mail('gmail/inbox'),
|
|
||||||
new_mail('ninthfloor/inbox')))
|
myrsslist = wibox.widget.textbox()
|
||||||
end)
|
myrsslist.set_count = function (self, count)
|
||||||
mymaillisttimer:start()
|
if count then
|
||||||
|
self:set_markup(" " .. count
|
||||||
if avandu then
|
.. " <span face=\"FontAwesome\"></span>")
|
||||||
myrsslist = wibox.widget.textbox()
|
else
|
||||||
myrsslist:set_markup(" " .. (avandu.unread() or '?') .. " <span face=\"FontAwesome\"></span>")
|
self:set_text("")
|
||||||
myrsslisttimer = timer({ timeout = 60 })
|
|
||||||
myrsslisttimer:connect_signal(
|
|
||||||
"timeout",
|
|
||||||
function ()
|
|
||||||
myrsslist:set_markup(" " .. (avandu.unread() or '?') .. " <span face=\"FontAwesome\"></span>")
|
|
||||||
end
|
end
|
||||||
)
|
|
||||||
myrsslisttimer:start()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function unlocked()
|
function unlocked()
|
||||||
|
@ -296,7 +289,11 @@ for s = 1, screen.count() do
|
||||||
local right_layout = wibox.layout.fixed.horizontal()
|
local right_layout = wibox.layout.fixed.horizontal()
|
||||||
if s == 1 then
|
if s == 1 then
|
||||||
if avandu then right_layout:add(myrsslist) end
|
if avandu then right_layout:add(myrsslist) end
|
||||||
right_layout:add(mymaillist)
|
|
||||||
|
for k, w in pairs(mailwidgets) do
|
||||||
|
right_layout:add(w)
|
||||||
|
end
|
||||||
|
|
||||||
-- right_layout:add(mykeyringlist)
|
-- right_layout:add(mykeyringlist)
|
||||||
right_layout:add(wibox.widget.systray())
|
right_layout:add(wibox.widget.systray())
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue