mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 05:02:50 +02:00
Generate five artwork slots, refresh VR shortcuts and managed collections, and retain a signal-aware launcher around setsid so stopping the wrapper cleans its container. Cover installation, artwork and launch cleanup offline; record the Steam client startup blocker for device verification. Co-Authored-By: GPT-6 Astra <noreply@openai.com>
52 lines
1.5 KiB
Python
Executable File
52 lines
1.5 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Stub for podman, for the fake Lepton instances (lepton.py): ps, stop, exec.
|
|
`podman ps --format "{{.Names}} {{.Labels.adb_port}}"` lists what's running,
|
|
as frame_android.running_instances reads it (docs/apks.md)."""
|
|
import os
|
|
import sys
|
|
import time
|
|
|
|
sys.path.insert(0, '/usr/local/lib/fakeframe')
|
|
import fakeframe_state as fs # noqa: E402
|
|
|
|
|
|
def alive(c):
|
|
try:
|
|
os.kill(c['pid'], 0)
|
|
return True
|
|
except OSError:
|
|
return False
|
|
|
|
|
|
args = sys.argv[1:]
|
|
fs.log('podman', args=args)
|
|
cmd = args[0] if args else ''
|
|
containers = {n: c for n, c in fs.read()['lepton'].items() if alive(c)}
|
|
if cmd == 'ps':
|
|
for name, c in sorted(containers.items()):
|
|
print(f"{name} {c['port']}")
|
|
elif cmd == 'inspect':
|
|
if args[-1] not in containers:
|
|
sys.exit(1)
|
|
print('true')
|
|
elif cmd == 'stop':
|
|
name = args[-1]
|
|
c = containers.get(name)
|
|
if not c:
|
|
sys.exit(f'Error: no container with name or ID "{name}" found: no such container')
|
|
os.kill(c['pid'], 15)
|
|
for _ in range(50):
|
|
if not alive(c):
|
|
break
|
|
time.sleep(0.1)
|
|
print(name)
|
|
elif cmd == 'exec':
|
|
name, rest = args[1], ' '.join(args[2:])
|
|
if name not in containers:
|
|
sys.exit(f'Error: no container with name or ID "{name}" found: no such container')
|
|
if 'pidof' in rest:
|
|
print(4242) # the app is "up"; there's no Android to ask
|
|
# logcat and anything else: nothing to report
|
|
else:
|
|
sys.exit(f'podman stub: unsupported {args}')
|