- alsabar.update()
-
- local preset =
- {
- title = "",
- text = "",
- timeout = 4,
- font = alsabar.notifications.font .. " " ..
- alsabar.notifications.font_size,
- fg = alsabar.notifications.color
- }
-
- if alsabar._muted
- then
- preset.title = alsabar.channel .. " - Muted"
- else
- preset.title = alsabar.channel .. " - " .. alsabar._current_level * 100 .. "%"
- end
-
- int = math.modf(alsabar._current_level * alsabar.notifications.bar_size)
- preset.text = "["
- .. string.rep("|", int)
- .. string.rep(" ", alsabar.notifications.bar_size - int)
- .. "]"
-
- if alsabar._notify ~= nil then
- alsabar._notify = naughty.notify ({
- replaces_id = alsabar._notify.id,
- preset = preset
- })
- else
- alsabar._notify = naughty.notify ({
- preset = preset
- })
- end
+ alsabar.update()
+
+ local preset = {
+ title = "",
+ text = "",
+ timeout = 4,
+ screen = alsabar.notifications.screen,
+ font = alsabar.notifications.font .. " " ..
+ alsabar.notifications.font_size,
+ fg = alsabar.notifications.color
+ }
+
+ if alsabar._muted
+ then
+ preset.title = alsabar.channel .. " - Muted"
+ else
+ preset.title = alsabar.channel .. " - " .. alsabar._current_level .. "%"
+ end
+
+ local int = math.modf((alsabar._current_level / 100) * alsabar.notifications.bar_size)
+ preset.text = string.format("[%s%s]", string.rep("|", int),
+ string.rep(" ", alsabar.notifications.bar_size - int))
+
+ if alsabar._notify ~= nil then
+ alsabar._notify = naughty.notify ({
+ replaces_id = alsabar._notify.id,
+ preset = preset,
+ })
+ else
+ alsabar._notify = naughty.notify ({
+ preset = preset,
+ })
+ end