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
|
||||
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
|
||||
-- }}}
|
||||
|
Loading…
Reference in New Issue
Block a user