mirror of https://github.com/lcpz/lain.git
Fix alsa widget updating unnecessarily (#516)
This commit is contained in:
parent
1db09ba186
commit
4933d6cb27
|
@ -36,8 +36,9 @@ local function factory(args)
|
||||||
function alsa.update()
|
function alsa.update()
|
||||||
helpers.async(format_cmd, function(mixer)
|
helpers.async(format_cmd, function(mixer)
|
||||||
local l,s = string.match(mixer, "([%d]+)%%.*%[([%l]*)")
|
local l,s = string.match(mixer, "([%d]+)%%.*%[([%l]*)")
|
||||||
|
l = tonumber(l)
|
||||||
if alsa.last.level ~= l or alsa.last.status ~= s then
|
if alsa.last.level ~= l or alsa.last.status ~= s then
|
||||||
volume_now = { level = tonumber(l), status = s }
|
volume_now = { level = l, status = s }
|
||||||
widget = alsa.widget
|
widget = alsa.widget
|
||||||
settings()
|
settings()
|
||||||
alsa.last = volume_now
|
alsa.last = volume_now
|
||||||
|
|
Loading…
Reference in New Issue