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