awesome: Make calendar widget actually hide

This commit is contained in:
Simon Bruder 2020-02-29 12:49:52 +00:00
parent 7d21067bd4
commit 387682fbce
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -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)