-
-
Save willycedric/ccae05575bb59a75d2e89cc06baf5e96 to your computer and use it in GitHub Desktop.
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
#!/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