X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/dc614905b0e55d80fcf78f28f3454833d513837a..555b872d16393774089df3b3453000571a73a3dd:/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