mirror of
https://github.com/Cogential/frametanium.git
synced 2026-10-17 16:00:28 +02:00
manager.py is a standard-library service on the Frame (port 8643). It lists each catalog port's releases, downloads the chosen asset (zip, or an AppImage it unpacks with --appimage-extract and gives a launcher), stages it next to ~/devkit-game/<gameid> and swaps it in, keeping ROMs placed next to run.sh and the previous install for rollback. It refuses while the game runs, fixes executable bits, registers the shortcut with Steam and adds library art. A token in the settings unlocks private repos. app/ is the controller-driven headset front end (C + SDL2, talks to the service over loopback with tab-separated replies); page.html is the browser one. deploy.sh installs both over SSH. Tested on the laptop against the real releases: install, version switch, ROM carry-over, rollback, the running-game guard, the AppImage path (under qemu), and both front ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VHDaz86aayqMULHsjByEmT
46 lines
2.3 KiB
Bash
Executable File
46 lines
2.3 KiB
Bash
Executable File
#!/bin/sh
|
|
# Installs or updates Port Manager on a Steam Frame from this computer over SSH: the service, and the
|
|
# "Port Manager" app in the Steam library with its art.
|
|
#
|
|
# Usage: ./deploy.sh [host] host defaults to frame.local
|
|
# Env: SSH_KEY (default ~/.ssh/frame_devkit), SSH_USER (default steamos)
|
|
# Build the app first with app/build-arm64.sh.
|
|
set -e
|
|
cd "$(dirname "$0")"
|
|
HOST="${1:-frame.local}"
|
|
KEY="${SSH_KEY:-$HOME/.ssh/frame_devkit}"
|
|
USER_AT="${SSH_USER:-steamos}@$HOST"
|
|
SSH="ssh -i $KEY -o ConnectTimeout=10"
|
|
GAMEID=Port_Manager
|
|
|
|
[ -x dist/app/port-manager ] || { echo "Build the app first: app/build-arm64.sh"; exit 1; }
|
|
$SSH "$USER_AT" true || { echo "Can't reach $HOST over SSH. Is the Frame on and on this network?"; exit 1; }
|
|
|
|
echo "== Service"
|
|
$SSH "$USER_AT" 'rm -rf ~/.cache/frame-port-manager-src && mkdir -p ~/.cache/frame-port-manager-src'
|
|
rsync -a -e "$SSH" manager.py page.html catalog.json frame-port-manager.service install.sh art "$USER_AT:.cache/frame-port-manager-src/"
|
|
$SSH "$USER_AT" 'sh ~/.cache/frame-port-manager-src/install.sh'
|
|
|
|
echo "== Headset app"
|
|
rsync -a --delete -e "$SSH" dist/app/ "$USER_AT:devkit-game/$GAMEID/"
|
|
$SSH "$USER_AT" "python3 ~/devkit-utils/steam-client-create-shortcut --parms '{\"gameid\": \"$GAMEID\", \"directory\": \"/home/steamos/devkit-game/$GAMEID\", \"argv\": [\"./run.sh\"], \"env\": {}, \"settings\": {\"compat_tool\": \"SteamLinuxRuntime_4-arm64\", \"steam_play\": \"0\"}}'" >/dev/null
|
|
|
|
echo "== Library art"
|
|
APPID=""
|
|
for i in 1 2 3 4 5 6 7 8 9 10; do
|
|
APPID=$($SSH "$USER_AT" "python3 - $GAMEID" < tools/find_appid.py) && [ -n "$APPID" ] && break
|
|
sleep 2
|
|
done
|
|
if [ -n "$APPID" ]; then
|
|
for USERDIR in $($SSH "$USER_AT" 'ls -d ~/.local/share/Steam/userdata/[1-9]*/config 2>/dev/null'); do
|
|
$SSH "$USER_AT" "mkdir -p $USERDIR/grid"
|
|
for pair in portrait.png:p.png wide.png:.png hero.png:_hero.png logo.png:_logo.png icon.png:_icon.png; do
|
|
rsync -a -e "$SSH" "art/app/${pair%%:*}" "$USER_AT:$USERDIR/grid/${APPID}${pair##*:}"
|
|
done
|
|
done
|
|
echo "Art added for app id $APPID (shows after Steam restarts)."
|
|
else
|
|
echo "Couldn't find the shortcut's app id yet; run this again later to add the art."
|
|
fi
|
|
echo "Done. Open \"Port Manager\" from the library, or http://$HOST:8643 in a browser."
|