X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/17fa506422e4eeee0de14a9989817af73bb0694f..bf3a9ba5efb874ad6370a3083afd409361e2912a:/widgets/pulsebar.lua?ds=sidebyside diff --git a/widgets/pulsebar.lua b/widgets/pulsebar.lua index 284b886..c75ad4a 100644 --- a/widgets/pulsebar.lua +++ b/widgets/pulsebar.lua @@ -51,8 +51,8 @@ local function worker(args) pulsebar.notifications = args.notification_preset if not pulsebar.notification_preset then - pulsebar.notification_preset = naughty.config.defaults - pulsebar.notification_preset.font = "Monospace 11" + pulsebar.notification_preset = {} + pulsebar.notification_preset.font = "Monospace 10" end pulsebar.bar = wibox.widget { @@ -129,17 +129,18 @@ local function worker(args) if pulsebar.followtag then preset.screen = awful.screen.focused() end - pulsebar.id = naughty.notify ({ - replaces_id = pulsebar.id, - preset = preset - }).id + if not pulsebar.notification then + pulsebar.notification = naughty.notify { + preset = preset, + destroy = function() pulsebar.notification = nil end + } + else + naughty.replace_text(pulsebar.notification, preset.title, preset.text) + end end) end - - timer_id = string.format("pulsebar-%s", pulsebar.sink) - - helpers.newtimer(timer_id, timeout, pulsebar.update) + helpers.newtimer(string.format("pulsebar-%s", pulsebar.sink), timeout, pulsebar.update) return pulsebar end