diff --git a/home/.config/awesome/widgets.lua b/home/.config/awesome/widgets.lua index eb87f3a..b50f673 100644 --- a/home/.config/awesome/widgets.lua +++ b/home/.config/awesome/widgets.lua @@ -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)