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
1 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ end
-- Volume control -- Volume control
function getVolume() 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 local volume = string.gsub(handle:read("*a"), "[\n%%]+", "") / 100
handle:close() handle:close()
return volume return volume
@ -154,11 +154,11 @@ local displayVolume = function()
timer:start() timer:start()
end end
local raiseVolume = function() local raiseVolume = function()
os.execute("amixer set Master 5%+") os.execute("amixer -D pulse set Master 5%+")
displayVolume() displayVolume()
end end
local lowerVolume = function() local lowerVolume = function()
os.execute("amixer set Master 5%-") os.execute("amixer -D pulse set Master 5%-")
displayVolume() displayVolume()
end end
-- }}} -- }}}