From a051cd5fa682cc0e6989a6e181a8a38981b2846d Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Sat, 5 Dec 2026 22:10:10 -0500 Subject: [PATCH] Retry Android shortcut connections after a quick relaunch --- .../linuxfs/overlay/usr/local/bin/droiddeck-android-app | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-android-app b/tools/linuxfs/overlay/usr/local/bin/droiddeck-android-app index 69aca90191..e96742f726 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-android-app +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-android-app @@ -33,8 +33,11 @@ flock -n 9 || fail "Close the running Android app shortcut first." adb start-server 9>&- || fail "Could not start the Android connection." trap 'adb kill-server 9>&- >/dev/null 2>&1 || true' EXIT trap 'exit 0' INT TERM HUP -timeout 8 adb connect "$serial" 9>&- || true -[ "$(timeout 5 adb -s "$serial" get-state 9>&- 2>/dev/null || true)" = device ] || +connected() { + timeout 8 adb connect "$serial" 9>&- >/dev/null 2>&1 || true + [ "$(timeout 3 adb -s "$serial" get-state 9>&- 2>/dev/null || true)" = device ] +} +connected || connected || fail "Android is disconnected. Turn on Wireless debugging, then restart Steam." export SDL_VIDEODRIVER=x11 @@ -42,4 +45,4 @@ export SDL_VIDEODRIVER=x11 scrcpy --serial "$serial" --new-display=1280x720/240 --start-app="$package" \ --window-title="Android app" --no-vd-system-decorations --no-clipboard-autosync \ --mouse-bind=----:---- --gamepad=uhid --no-audio --max-fps=60 9>&- || - fail "The Android app window closed unexpectedly. Check Wireless debugging and try again." + fail "The Android app window closed unexpectedly. Try launching it again."