Fix audio level control not working on some configs

This commit is contained in:
Alice Gaudon 2019-07-25 16:12:05 +02:00
parent 2e93a077d0
commit a57fc53a27

View File

@ -28,7 +28,7 @@ end
-- Volume control
function getVolume()
local handle = io.popen("amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n 1", "r")
local handle = io.popen("amixer -D pulse sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n 1", "r")
local volume = string.gsub(handle:read("*a"), "[\n%%]+", "") / 100
handle:close()
return volume
@ -154,11 +154,11 @@ local displayVolume = function()
timer:start()
end
local raiseVolume = function()
os.execute("amixer set Master 5%+")
os.execute("amixer -D pulse set Master 5%+")
displayVolume()
end
local lowerVolume = function()
os.execute("amixer set Master 5%-")
os.execute("amixer -D pulse set Master 5%-")
displayVolume()
end
-- }}}