From d6c0fc2014e8bfcec21e6514ab13f5e41b9dddb8 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Jun 2026 22:26:56 +0000 Subject: [PATCH] fix: _steam_home() prefers container that is currently running With multiple WolfSteam containers, the previous head -1 pick was arbitrary. Now matches each Steam state directory against running container IDs so ge-proton, fix-ea-game, and other commands all target the active session. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs --- services/wolf.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/services/wolf.sh b/services/wolf.sh index 406955a..73b43d0 100644 --- a/services/wolf.sh +++ b/services/wolf.sh @@ -959,6 +959,19 @@ WOLF_TZ=$(grep '^WOLF_TZ=' "$SCRIPT_DIR/.env" 2>/dev/null | cut -d= -f2-) # Locate the Steam home under the Wolf state folder (born on first Steam launch). _steam_home() { + # Prefer the Steam home whose container is currently running. + # With multiple WolfSteam containers, head -1 picks the wrong one. + local candidate running_ids + running_ids=$(docker ps --format '{{.Names}}' | grep -i WolfSteam | sed 's/WolfSteam_//') + while IFS= read -r candidate; do + local cid + cid=$(basename "$(dirname "$candidate")") + if echo "$running_ids" | grep -qF "$cid"; then + echo "$candidate" + return 0 + fi + done < <(find "${WOLF_STATE_DIR:-/etc/wolf}" -maxdepth 2 -type d -name Steam 2>/dev/null) + # Fallback: first found find "${WOLF_STATE_DIR:-/etc/wolf}" -maxdepth 2 -type d -name Steam 2>/dev/null | head -1 }