forked from ashpie/simple-awesome
media_control.lua: fix isMuted function not working on some devices
This commit is contained in:
parent
f56403f0bf
commit
97e8188a1a
@ -43,7 +43,7 @@ end
|
||||
|
||||
function isMuted()
|
||||
local handle = io.popen("amixer " .. config.audio.card .. " sget '" .. config.audio.device .. "' | egrep 'Playback.*?\\[o' | egrep -o '\\[o.+\\]'", "r")
|
||||
local muted = string.gsub(handle:read("*a"), "[\n]+", "") == "[off]"
|
||||
local muted = string.match(string.gsub(handle:read("*a"), "[\n]+", ""), "off")
|
||||
handle:close()
|
||||
return muted
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user