X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/03fdf984e93d81ed95945db51c83baf6c23e89e8..2d35d4e102074ae449ec1f4d261517fe06c5a01d:/widgets/alsabar.lua diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index c3e3d9d..90c60b4 100644 --- a/widgets/alsabar.lua +++ b/widgets/alsabar.lua @@ -50,8 +50,8 @@ local function worker(args) alsabar.notification_preset = args.notification_preset if not alsabar.notification_preset then - alsabar.notification_preset = naughty.config.defaults - alsabar.notification_preset.font = "Monospace 11" + alsabar.notification_preset = {} + alsabar.notification_preset.font = "Monospace 10" end local format_cmd = string.format("%s get %s", alsabar.cmd, alsabar.channel) @@ -119,10 +119,15 @@ local function worker(args) if alsabar.followtag then preset.screen = awful.screen.focused() end - alsabar.id = naughty.notify ({ - replaces_id = alsabar.id, - preset = preset - }).id + if not alsabar.notification then + alsabar.notification = naughty.notify { + preset = preset, + destroy = function() alsabar.notification = nil end + } + else + naughty.replace_text(alsabar.notification, preset.title, preset.text) + naughty.reset_timeout(alsabar.notification, preset.timeout) + end end) end