From 12f2ec0817f25b8bb822ac1c3ffac0f989aee98c Mon Sep 17 00:00:00 2001 From: copycat-killer Date: Sat, 28 Mar 2015 11:39:45 +0100 Subject: [PATCH 1/1] alsabar: string.format use for preset.text in alsabar._notify --- widgets/alsabar.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index b12e55c..d233b28 100644 --- a/widgets/alsabar.lua +++ b/widgets/alsabar.lua @@ -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 ({ -- 2.39.5