alsabar: string.format use for preset.text in alsabar._notify

This commit is contained in:
copycat-killer 2015-03-28 11:39:45 +01:00
parent 49221b8055
commit 12f2ec0817
1 changed files with 3 additions and 5 deletions

View File

@ -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 ({