Skip to content

Instantly share code, notes, and snippets.

@derailius
Created February 28, 2020 07:14
Show Gist options
  • Save derailius/6c1fbaab821f5945003e4dd98f978512 to your computer and use it in GitHub Desktop.
Save derailius/6c1fbaab821f5945003e4dd98f978512 to your computer and use it in GitHub Desktop.
hdrswitch
#!/bin/bash
#there are a couple of extra KEYCODE presses in a couple of spots so that the script doesn't go too fast
firestickip="192.168.0.193"
adb kill-server
adb connect $firestickip
adb wait-for-device
adb shell am force-stop com.plexapp.android #kills plex
adb shell am force-stop org.xbmc.kodi #kills kodi
adb shell input keyevent KEYCODE_HOME
adb shell am start -a android.settings.SETTINGS
adb shell input keyevent KEYCODE_DPAD_DOWN KEYCODE_DPAD_RIGHT KEYCODE_DPAD_RIGHT KEYCODE_DPAD_CENTER KEYCODE_DPAD_DOWN KEYCODE_DPAD_UP KEYCODE_DPAD_DOWN KEYCODE_DPAD_CENTER
adb shell input keyevent KEYCODE_DPAD_UP KEYCODE_DPAD_UP KEYCODE_DPAD_DOWN KEYCODE_DPAD_DOWN KEYCODE_DPAD_DOWN KEYCODE_DPAD_DOWN KEYCODE_DPAD_DOWN KEYCODE_DPAD_CENTER
adb shell input keyevent KEYCODE_DPAD_UP KEYCODE_DPAD_CENTER #HDR SWITCH HERE
adb shell input keyevent KEYCODE_DPAD_LEFT KEYCODE_DPAD_CENTER KEYCODE_HOME
#launches plex
adb shell monkey --pct-syskeys 0 -p com.plexapp.android -c android.intent.category.LAUNCHER 1;
sleep 1;
adb kill-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment