Skip to content

Instantly share code, notes, and snippets.

@Alistair1231
Last active July 5, 2024 12:28
Show Gist options
  • Save Alistair1231/a01d0f909cb9d60ad6ecb89ea228865e to your computer and use it in GitHub Desktop.
Save Alistair1231/a01d0f909cb9d60ad6ecb89ea228865e to your computer and use it in GitHub Desktop.
twitch scrcpy script
DEVICE=$(adb devices | sed -n '2 p' | cut -f 1)
# set window title
echo -en "\033]0;SCRCPY\007"
adb -s $DEVICE shell wm size 1080x1920
# stop twitch from avoiding cutout
adb -s $DEVICE shell cmd overlay enable com.android.internal.display.cutout.emulation.noCutout
adb -s $DEVICE shell cmd overlay enable com.android.internal.display.cutout.emulation.corner
# if device is ip then use 2M bitrate and 200 buffer
if [[ $DEVICE == *:* ]];then
scrcpy -s $DEVICE -b 2M --display-buffer=200 --audio-buffer=200
else
scrcpy -s $DEVICE
fi
# undo changes
adb -s $DEVICE shell wm size reset
adb -s $DEVICE shell cmd overlay disable com.android.internal.display.cutout.emulation.noCutout
adb -s $DEVICE shell cmd overlay disable com.android.internal.display.cutout.emulation.corner
echo -en "\033]0;Alacritty\007"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment