Created
November 1, 2024 15:20
-
-
Save chickendrop89/53f5b5f6be3a9289aaaf6503894a4189 to your computer and use it in GitHub Desktop.
Magisk volume key selection function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
volumeselect() { | |
while true; | |
do | |
getevent -lc 1 2>&1 | grep VOLUME | grep DOWN > "$TMPDIR"/events | |
if grep VOLUME "$TMPDIR"/events >/dev/null; | |
then break | |
fi | |
done | |
if grep VOLUMEUP "$TMPDIR"/events >/dev/null; | |
then return 0 | |
else return 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment