X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/f63a7fd098e3826e397c16938968a1a840150abe..95cc2d2512a930ca6101f17d5bc9fdcc2fa6d147:/widgets/alsabar.lua?ds=inline diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index 7e8cd5a..83e27b5 100644 --- a/widgets/alsabar.lua +++ b/widgets/alsabar.lua @@ -127,7 +127,7 @@ local function worker(args) -- Capture mixer control state: [5%] ... ... [on] local volu, mute = string.match(mixer, "([%d]+)%%.*%[([%l]*)") - if tonumber(volu) ~= alsabar._current_level or string.match(mute, "on") ~= alsabar._muted + if (volu and tonumber(volu) ~= alsabar._current_level) or string.match(mute, "on") ~= alsabar._muted then alsabar._current_level = tonumber(volu) alsabar.bar:set_value(alsabar._current_level / 100)