Last active
June 23, 2023 13:50
-
-
Save vshymanskyy/a44ff7af2848653e91f269910cb9d50f to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
### | |
# Requires Null Keyboard https://play.google.com/store/apps/details?id=com.wparam.nullkeyboard | |
# Author: Volodymyr Shymanskyy | |
### | |
brightness=$(adb shell settings get system screen_brightness) | |
ime=$(adb shell settings get secure default_input_method) | |
trap restore INT | |
function setup() { | |
# Wakeup to process commands faster | |
adb shell input keyevent KEYCODE_WAKEUP | |
# Always-on screen | |
adb shell svc power stayon usb | |
# Set brightness | |
adb shell settings put system screen_brightness_mode 0 | |
adb shell settings put system screen_brightness 0 | |
# Disable Keyboard | |
adb shell ime set com.wparam.nullkeyboard/.NullKeyboard | |
# Show Touches | |
adb shell settings put system show_touches 1 | |
} | |
function restore() { | |
echo Restoring settings | |
adb shell svc power stayon false | |
adb shell settings put system screen_brightness_mode 1 | |
adb shell settings put system screen_brightness $brightness | |
adb shell ime set org.pocketworkstation.pckeyboard/.LatinIME #$ime | |
adb shell settings put system show_touches 0 | |
exit 0 | |
} | |
setup | |
scrcpy -m 768 | |
restore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I created a windows batch script based on this: https://gist.github.com/sharunkumar/ca2cd57936e4bac974578d1e8a6b3cf6