Fix audio level control not working on some configs
This commit is contained in:
parent
2e93a077d0
commit
a57fc53a27
@ -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
|
||||||
-- }}}
|
-- }}}
|
||||||
|
Loading…
Reference in New Issue
Block a user