X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/e0d4a89435d68714c0cee849625e0b14edca3d1c..43cd98510a33e9f2d50d315a9bfc31ff8d3062c9:/widgets/pulsebar.lua diff --git a/widgets/pulsebar.lua b/widgets/pulsebar.lua index 284b886..5453b1f 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,19 @@ 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) + naughty.reset_timeout(pulsebar.notification, preset.timeout) + 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