awesome: Make calendar widget actually hide
This commit is contained in:
parent
7d21067bd4
commit
387682fbce
|
@ -193,19 +193,32 @@ widgets.cal = {}
|
|||
widgets.cal.show = function()
|
||||
widgets.cal.hide()
|
||||
|
||||
widgets.cal.notification_processing = true
|
||||
|
||||
helpers.async({ "khal", "calendar" }, function(output)
|
||||
widgets.cal.notification = naughty.notify{
|
||||
screen = awful.screen.focused(),
|
||||
text = output:gsub("\n$", ""),
|
||||
timeout = 0,
|
||||
}
|
||||
|
||||
widgets.cal.notification_processing = false
|
||||
|
||||
if widgets.cal.trigger_hide then
|
||||
widgets.cal.hide()
|
||||
widgets.cal.trigger_hide = false
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
widgets.cal.hide = function()
|
||||
if not widgets.cal.notification then return end
|
||||
naughty.destroy(widgets.cal.notification)
|
||||
widgets.cal.notification = nil
|
||||
if widgets.cal.notification_processing then
|
||||
widgets.cal.trigger_hide = true
|
||||
else
|
||||
if not widgets.cal.notification then return end
|
||||
naughty.destroy(widgets.cal.notification)
|
||||
widgets.cal.notification = nil
|
||||
end
|
||||
end
|
||||
|
||||
widgets.cal.attach = function(parent)
|
||||
|
|
Reference in a new issue