Skip to content

Instantly share code, notes, and snippets.

@maz-1
Last active September 16, 2017 13:37
Show Gist options
  • Save maz-1/9261a097e128c6aedb71c68a58909299 to your computer and use it in GitHub Desktop.
Save maz-1/9261a097e128c6aedb71c68a58909299 to your computer and use it in GitHub Desktop.
Kernel Adiutor custom setting to tweak headphone gain through sound_control
{"version":1,"control":{"apply":"#!\/system\/bin\/sh\n\necho $1 > \/sys\/kernel\/sound_control\/headphone_gain\n#echo \"-20 -20\" > \/sys\/kernel\/sound_control\/headphone_gain","value":"#!\/system\/bin\/sh\n\n\norigval=$(cat \/sys\/kernel\/sound_control\/headphone_gain)\nleftval=${origval% *}\nrightval=${origval#* }\n\nif [ $leftval -ge 172 ]\nthen\n leftval=$(expr $leftval - 256)\nfi\n\nif [ $rightval -ge 172 ]\nthen\n rightval=$(expr $rightval - 256)\nfi\n\necho $leftval $rightval","title":"headphone volume control","description":"headphone volume gain","id":"generic"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment