X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/f63a7fd098e3826e397c16938968a1a840150abe..bd1c6e20bbac7be806d4f5e793960c1bc6846797:/widgets/alsabar.lua 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)