Skip to content

Instantly share code, notes, and snippets.

@chickendrop89
Created November 1, 2024 15:20
Show Gist options
  • Save chickendrop89/53f5b5f6be3a9289aaaf6503894a4189 to your computer and use it in GitHub Desktop.
Save chickendrop89/53f5b5f6be3a9289aaaf6503894a4189 to your computer and use it in GitHub Desktop.
Magisk volume key selection function
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