From 97e8188a1ac15324d35e0f04723ae1a965f73668 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 12 Apr 2020 14:59:17 +0200 Subject: [PATCH] media_control.lua: fix isMuted function not working on some devices --- simple/media_control.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple/media_control.lua b/simple/media_control.lua index 52e0d84..589c33a 100644 --- a/simple/media_control.lua +++ b/simple/media_control.lua @@ -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