X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/f63a7fd098e3826e397c16938968a1a840150abe..86432aa3a2f8c6437ec47e5dd88b110612329e6e:/widgets/alsabar.lua?ds=sidebyside diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index 7e8cd5a..39bf394 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 (mute and string.match(mute, "on") ~= alsabar._muted) then alsabar._current_level = tonumber(volu) alsabar.bar:set_value(alsabar._current_level / 100)