Fix alsa widget updating unnecessarily (#516)

This commit is contained in:
Albin Wahlén 2021-09-25 13:53:06 +02:00 committed by GitHub
parent 1db09ba186
commit 4933d6cb27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -36,8 +36,9 @@ local function factory(args)
function alsa.update()
helpers.async(format_cmd, function(mixer)
local l,s = string.match(mixer, "([%d]+)%%.*%[([%l]*)")
l = tonumber(l)
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
settings()
alsa.last = volume_now