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.show = function()
|
||||||
widgets.cal.hide()
|
widgets.cal.hide()
|
||||||
|
|
||||||
|
widgets.cal.notification_processing = true
|
||||||
|
|
||||||
helpers.async({ "khal", "calendar" }, function(output)
|
helpers.async({ "khal", "calendar" }, function(output)
|
||||||
widgets.cal.notification = naughty.notify{
|
widgets.cal.notification = naughty.notify{
|
||||||
screen = awful.screen.focused(),
|
screen = awful.screen.focused(),
|
||||||
text = output:gsub("\n$", ""),
|
text = output:gsub("\n$", ""),
|
||||||
timeout = 0,
|
timeout = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
widgets.cal.notification_processing = false
|
||||||
|
|
||||||
|
if widgets.cal.trigger_hide then
|
||||||
|
widgets.cal.hide()
|
||||||
|
widgets.cal.trigger_hide = false
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
widgets.cal.hide = function()
|
widgets.cal.hide = function()
|
||||||
if not widgets.cal.notification then return end
|
if widgets.cal.notification_processing then
|
||||||
naughty.destroy(widgets.cal.notification)
|
widgets.cal.trigger_hide = true
|
||||||
widgets.cal.notification = nil
|
else
|
||||||
|
if not widgets.cal.notification then return end
|
||||||
|
naughty.destroy(widgets.cal.notification)
|
||||||
|
widgets.cal.notification = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
widgets.cal.attach = function(parent)
|
widgets.cal.attach = function(parent)
|
||||||
|
|
Reference in a new issue