X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/f63a7fd098e3826e397c16938968a1a840150abe..8c8d2925a5e108f4909f4ac06f95efc638fe950e:/widgets/alsabar.lua?ds=sidebyside 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)