mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 18:00:40 +02:00
Dropping a game's .zip, folder or .exe on Send to Frame now adds it to the headset's Steam library through Valve's SteamOS Devkit title path, with the runtime picked from the program's header: Windows PE -> Proton Experimental (steam_play=1), aarch64 ELF -> SteamLinuxRuntime_4-arm64, x86-64 ELF -> SteamLinuxRuntime_4 (through FEX). Other architectures are refused. - frame/devkit-utils: Valve's devkit-utils vendored unmodified (MIT, steamos-devkit v0.20260925.1), synced to ~/devkit-utils by stamp, bundled in the app and compiled in CI. - ui/frame_titles.py: inspect (safe unzip, ELF/PE classification, launch target ranking), install(path, name=None, exe=None, runtime=None, progress=None), list, launch, remove, plus a CLI. - ui/server.py: /api/titles (inspect/install/discard/launch/remove), /api/titles/job progress, and an upload mode 'title'. - ui/index.html: confirm dialog (name, launch target, runtime), install progress, and a Sideloaded titles list with Launch and Remove. The app's preload passes a dropped folder's path. - tests and docs/sideloading.md. Device-side behaviour is inferred from Valve's source; the headset was offline, so none of it has been checked on a Frame yet. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
58 lines
2.0 KiB
Python
58 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import logging
|
|
import argparse
|
|
import tempfile
|
|
import json
|
|
from urllib.parse import quote_plus as urllib_quote_plus
|
|
|
|
import devkit_utils
|
|
|
|
logging.basicConfig(format='%(message)s', level=logging.DEBUG)
|
|
logger = logging.getLogger(__name__)
|
|
|
|
DEVKIT_TOOL_FOLDER = os.path.expanduser('~/devkit-game')
|
|
|
|
if __name__ == '__main__':
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('--verbose', required=False, action='store_true')
|
|
parser.add_argument('--appid', required=False, action='store')
|
|
parser.add_argument('--gameid', required=False, action='store')
|
|
conf = parser.parse_args()
|
|
|
|
if conf.verbose:
|
|
logger.setLevel(logging.DEBUG)
|
|
else:
|
|
logger.setLevel(logging.INFO)
|
|
|
|
ret = {}
|
|
|
|
try:
|
|
devkit_utils.validate_steam_client()
|
|
except devkit_utils.SteamClientNotRunningException as e:
|
|
skipping = 'The Steam client is not running.'
|
|
logger.warning(skipping)
|
|
ret['error'] = skipping
|
|
else:
|
|
with tempfile.TemporaryDirectory(prefix='controller-config') as tempdir:
|
|
response = os.path.join(tempdir, 'dumpcontrollerconfig')
|
|
cmd = f'dumpcontrollerconfig?response={urllib_quote_plus(response)}'
|
|
if conf.appid:
|
|
cmd += f'&appid={conf.appid}'
|
|
if conf.gameid:
|
|
cmd += f'&gameid={conf.gameid}'
|
|
logger.debug(f'command: {cmd}')
|
|
devkit_utils.execute_steam_client_command(cmd)
|
|
try:
|
|
with devkit_utils.wait_on_file_response(response) as success_response:
|
|
logger.debug(success_response)
|
|
ret['success'] = success_response
|
|
except devkit_utils.SteamResponse_Timeout:
|
|
ret['error'] = 'timeout - Steam did not respond to the command request'
|
|
except devkit_utils.SteamResponse_Error as e:
|
|
ret['error'] = e.error_response
|
|
|
|
# response gets written out to stdout
|
|
print(json.dumps(ret))
|