wolf: add steam-setup-frontends to wait for Steam sign-in then auto-wire ES-DE/RetroArch
Steam Guard's QR-code sign-in can't be scripted (needs a phone approving a prompt), so this polls for it instead: starts Wolf if needed, waits for Steam's userdata/ to appear (or proceeds immediately if already signed in), then re-invokes the existing steam-add-nonsteam-game command for whichever of ES-DE.AppImage/RetroArch.AppImage was downloaded during install. Points to ./manage.sh cores all for the shared cores/shaders/ overlays directory rather than duplicating that download logic. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Z4nqULUEipWNgBsPoSuAb
This commit is contained in:
+76
-5
@@ -1059,8 +1059,8 @@ UDEV
|
|||||||
ln -sf "$(basename "$_ESDE_REAL")" "$_EMU_DIR/ES-DE.AppImage"
|
ln -sf "$(basename "$_ESDE_REAL")" "$_EMU_DIR/ES-DE.AppImage"
|
||||||
chown -h "$ACTUAL_USER:$ACTUAL_USER" "$_EMU_DIR/ES-DE.AppImage" 2>/dev/null || true
|
chown -h "$ACTUAL_USER:$ACTUAL_USER" "$_EMU_DIR/ES-DE.AppImage" 2>/dev/null || true
|
||||||
log_success "Linked $_EMU_DIR/ES-DE.AppImage -> $(basename "$_ESDE_REAL")"
|
log_success "Linked $_EMU_DIR/ES-DE.AppImage -> $(basename "$_ESDE_REAL")"
|
||||||
log_info "Once you've signed into Steam once in Moonlight, run:"
|
log_info "Once Wolf is running, add it to Steam with: cd $WOLF_DIR && ./manage.sh steam-setup-frontends"
|
||||||
log_info " cd $WOLF_DIR && ./manage.sh steam-add-nonsteam-game es-de \"EmulationStation (ES-DE)\""
|
log_info "(waits for Steam sign-in — QR code via Moonlight — then wires this in automatically)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -1090,8 +1090,8 @@ UDEV
|
|||||||
ln -sf "$(basename "$_RA_REAL")" "$_EMU_DIR/RetroArch.AppImage"
|
ln -sf "$(basename "$_RA_REAL")" "$_EMU_DIR/RetroArch.AppImage"
|
||||||
chown -h "$ACTUAL_USER:$ACTUAL_USER" "$_EMU_DIR/RetroArch.AppImage" 2>/dev/null || true
|
chown -h "$ACTUAL_USER:$ACTUAL_USER" "$_EMU_DIR/RetroArch.AppImage" 2>/dev/null || true
|
||||||
log_success "Linked $_EMU_DIR/RetroArch.AppImage -> $(basename "$_RA_REAL")"
|
log_success "Linked $_EMU_DIR/RetroArch.AppImage -> $(basename "$_RA_REAL")"
|
||||||
log_info "Once you've signed into Steam once in Moonlight, run:"
|
log_info "Once Wolf is running, add it to Steam with: cd $WOLF_DIR && ./manage.sh steam-setup-frontends"
|
||||||
log_info " cd $WOLF_DIR && ./manage.sh steam-add-nonsteam-game retroarch \"RetroArch\""
|
log_info "(waits for Steam sign-in — QR code via Moonlight — then wires this in automatically)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -3730,7 +3730,7 @@ _manage_wolf_complete() {
|
|||||||
local commands="start stop restart logs status pin controllers update apps cores reorder
|
local commands="start stop restart logs status pin controllers update apps cores reorder
|
||||||
add-web ge-proton games setup-swbf2 fix-ea-game wait-ea-app
|
add-web ge-proton games setup-swbf2 fix-ea-game wait-ea-app
|
||||||
install-ea-app diagnose-ea fix-perms install-completion backup
|
install-ea-app diagnose-ea fix-perms install-completion backup
|
||||||
steam-add-nonsteam-game cemu-clone-controller cemu-sync-controllers"
|
steam-add-nonsteam-game steam-setup-frontends cemu-clone-controller cemu-sync-controllers"
|
||||||
COMPREPLY=( $(compgen -W "$commands" -- "$cur") )
|
COMPREPLY=( $(compgen -W "$commands" -- "$cur") )
|
||||||
}
|
}
|
||||||
# Register for both 'manage.sh' and './manage.sh' invocation styles
|
# Register for both 'manage.sh' and './manage.sh' invocation styles
|
||||||
@@ -4190,6 +4190,75 @@ VDFPY
|
|||||||
echo "'Force the use of a specific Steam Play compatibility tool' is OFF — Cemu and"
|
echo "'Force the use of a specific Steam Play compatibility tool' is OFF — Cemu and"
|
||||||
echo "other native Linux AppImages don't run through Proton."
|
echo "other native Linux AppImages don't run through Proton."
|
||||||
;;
|
;;
|
||||||
|
steam-setup-frontends)
|
||||||
|
# One command covering what the ES-DE/RetroArch AppImage download
|
||||||
|
# step in setup.sh can't finish on its own: that step runs before
|
||||||
|
# Wolf/Steam containers even exist, so it can only download the
|
||||||
|
# AppImages and print instructions. This picks up from there —
|
||||||
|
# start Steam if needed, WAIT for it to be signed in (Steam Guard's
|
||||||
|
# QR-code sign-in itself can't be scripted: it needs a phone
|
||||||
|
# approving a prompt, so this only polls for the result, never
|
||||||
|
# performs the sign-in), then add whichever AppImage(s) already got
|
||||||
|
# downloaded as Steam non-Steam games via the existing
|
||||||
|
# steam-add-nonsteam-game command above (re-invoked, not
|
||||||
|
# reimplemented, so the two never drift apart).
|
||||||
|
if ! docker ps --format '{{.Names}}' | grep -qi WolfSteam; then
|
||||||
|
echo "Starting Wolf (docker compose up -d)..."
|
||||||
|
docker compose up -d
|
||||||
|
sleep 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
_SSF_SIGNED_IN() {
|
||||||
|
local _home
|
||||||
|
_home=$(_steam_home)
|
||||||
|
[ -n "$_home" ] && [ -n "$(sudo ls "$_home/.steam/steam/userdata/" 2>/dev/null)" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if _SSF_SIGNED_IN; then
|
||||||
|
echo "Steam is already signed in — proceeding."
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "Steam isn't signed in yet. In Moonlight:"
|
||||||
|
echo " 1. Connect to the Steam app."
|
||||||
|
echo " 2. On Steam's login screen, choose 'Sign in with QR code'."
|
||||||
|
echo " 3. Scan it with your phone's Steam app and approve the prompt."
|
||||||
|
echo ""
|
||||||
|
echo "Waiting for sign-in (up to 10 minutes, checking every 5s — Ctrl+C to give up"
|
||||||
|
echo "and finish this later by re-running './manage.sh steam-setup-frontends')..."
|
||||||
|
_SSF_WAITED=0
|
||||||
|
until _SSF_SIGNED_IN; do
|
||||||
|
sleep 5
|
||||||
|
_SSF_WAITED=$((_SSF_WAITED + 5))
|
||||||
|
if [ "$_SSF_WAITED" -ge 600 ]; then
|
||||||
|
echo "Still not signed in after 10 minutes — giving up for now."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "Signed in."
|
||||||
|
fi
|
||||||
|
|
||||||
|
GAME_DIR=$(grep '^GAME_STORAGE_DIR=' "$SCRIPT_DIR/.env" 2>/dev/null | cut -d= -f2-)
|
||||||
|
if [ -z "$GAME_DIR" ]; then read -r -p " Game storage path: " GAME_DIR; fi
|
||||||
|
_SSF_EMU_DIR="$GAME_DIR/emulators"
|
||||||
|
_SSF_ADDED_ANY=0
|
||||||
|
if [ -f "$_SSF_EMU_DIR/ES-DE.AppImage" ]; then
|
||||||
|
"$0" steam-add-nonsteam-game es-de "EmulationStation (ES-DE)" && _SSF_ADDED_ANY=1
|
||||||
|
else
|
||||||
|
echo "ES-DE.AppImage not found in $_SSF_EMU_DIR — download it first: sudo ./setup.sh wolf"
|
||||||
|
fi
|
||||||
|
if [ -f "$_SSF_EMU_DIR/RetroArch.AppImage" ]; then
|
||||||
|
"$0" steam-add-nonsteam-game retroarch "RetroArch" && _SSF_ADDED_ANY=1
|
||||||
|
else
|
||||||
|
echo "RetroArch.AppImage not found in $_SSF_EMU_DIR — download it first: sudo ./setup.sh wolf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$_SSF_ADDED_ANY" = 1 ]; then
|
||||||
|
echo ""
|
||||||
|
echo "Cores/shaders/overlays live in the same retroarch/ directory the esde/retroarch apps"
|
||||||
|
echo "already use (shared mount — nothing new to configure there). If you haven't already:"
|
||||||
|
echo " ./manage.sh cores all (downloads every libretro core + shaders/overlays/database)"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
cemu-clone-controller)
|
cemu-clone-controller)
|
||||||
# Clones a WORKING Cemu controller mapping onto a new device slot,
|
# Clones a WORKING Cemu controller mapping onto a new device slot,
|
||||||
# skipping Cemu's own Input Settings dialog entirely for that slot.
|
# skipping Cemu's own Input Settings dialog entirely for that slot.
|
||||||
@@ -4503,6 +4572,8 @@ SYNCPY
|
|||||||
echo " ./manage.sh install-completion - Enable tab-completion for this script"
|
echo " ./manage.sh install-completion - Enable tab-completion for this script"
|
||||||
echo " ./manage.sh steam-add-nonsteam-game [name] [display name]"
|
echo " ./manage.sh steam-add-nonsteam-game [name] [display name]"
|
||||||
echo " - Add an emulator (emulators/) as a non-Steam game, no GUI needed"
|
echo " - Add an emulator (emulators/) as a non-Steam game, no GUI needed"
|
||||||
|
echo " ./manage.sh steam-setup-frontends - Wait for Steam sign-in (QR code via Moonlight), then add"
|
||||||
|
echo " downloaded ES-DE/RetroArch AppImages to Steam"
|
||||||
echo " ./manage.sh cemu-clone-controller [slot 0-3] [uuid] [display name]"
|
echo " ./manage.sh cemu-clone-controller [slot 0-3] [uuid] [display name]"
|
||||||
echo " - Clone a working Cemu controller mapping onto a new device slot"
|
echo " - Clone a working Cemu controller mapping onto a new device slot"
|
||||||
echo " ./manage.sh cemu-sync-controllers - Auto-detect connected controllers via SDL and clone mappings onto all of them"
|
echo " ./manage.sh cemu-sync-controllers - Auto-detect connected controllers via SDL and clone mappings onto all of them"
|
||||||
|
|||||||
Reference in New Issue
Block a user