X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/9f6c36adbae22c35ccb779254ddb967c1f5e547d..172bc21bcf44f6b978ac224351fd673144ba8fa0:/widgets/alsabar.lua diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index fa10bc2..b2cba9e 100644 --- a/widgets/alsabar.lua +++ b/widgets/alsabar.lua @@ -27,7 +27,7 @@ local setmetatable = setmetatable local alsabar = { card = "0", channel = "Master", - step = "5%", + step = "2%", colors = { background = beautiful.bg_normal, @@ -70,11 +70,9 @@ function alsabar.notify() preset.title = alsabar.channel .. " - " .. alsabar._current_level .. "%" end - int = math.modf((alsabar._current_level / 100) * alsabar.notifications.bar_size) - preset.text = "[" - .. string.rep("|", int) - .. string.rep(" ", alsabar.notifications.bar_size - int) - .. "]" + 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 ({