docs: steam-machine-iso: live-session quirks; scripts/qmptype.py types into the VM

This commit is contained in:
theupriser committed 2026-09-27 20:01:41 +02:00
1 parent 8d5cdaea99
commit f8aac02d0a
2 files changed
+35

No files matched your search

+13
View File
@@ -125,3 +125,16 @@ unit), through Calamares, then check
kernel may fail even when DKMS built for the installed kernels. Real kernel may fail even when DKMS built for the installed kernels. Real
hardware (Steam Machine, USB stick) is the final test: gamescope, LEDs, CEC, hardware (Steam Machine, USB stick) is the final test: gamescope, LEDs, CEC,
power-off. power-off.
## Live-session quirks
- Copy/paste doesn't reach QEMU over Moonlight: type commands with
`python3 scripts/qmptype.py <vm dir>/qmp.sock "<command>"` (US layout, adds
Enter; the VM window's terminal must have focus). QMP `screendump` gives "no
surface" with virgl: screenshot the Steam Machine's desktop instead
(`spectacle -b -n -f -o /tmp/host.png` in its session).
- CachyOS Hello refuses to start the installer on a self-built ISO ("testing
ISO"): run `calamares-online.sh` in Konsole.
- `cachyos-calamares-next 3.4.2-13` needs `libboost_*.so.1.91.0` while the
repos ship Boost 1.92: steamify-prepare.sh puts 1.91's libraries on the ISO
(from archive.archlinux.org) until CachyOS rebuilds it.
+22
View File
@@ -0,0 +1,22 @@
# qmptype.py <qmp socket> <text>: types <text> (US layout) into the VM, then Enter.
import socket, json, sys, time
sock, text = sys.argv[1], sys.argv[2]
s = socket.socket(socket.AF_UNIX); s.connect(sock); f = s.makefile("rw"); f.readline()
def cmd(c):
f.write(json.dumps(c) + "\n"); f.flush(); return f.readline()
cmd({"execute": "qmp_capabilities"})
plain = {" ": "spc", "/": "slash", ".": "dot", "-": "minus", "'": "apostrophe", "\n": "ret",
"=": "equal", ",": "comma", ";": "semicolon", "\\": "backslash", "[": "bracket_left", "]": "bracket_right"}
shifted = {"&": "7", "*": "8", "_": "minus", ":": "semicolon", "|": "backslash", "~": "grave_accent",
"!": "1", "@": "2", "#": "3", "$": "4", "%": "5", "^": "6", "(": "9", ")": "0", "+": "equal", '"': "apostrophe"}
for ch in text + "\n":
keys = []
if ch.isalpha():
if ch.isupper(): keys.append("shift")
keys.append(ch.lower())
elif ch.isdigit(): keys.append(ch)
elif ch in plain: keys.append(plain[ch])
elif ch in shifted: keys += ["shift", shifted[ch]]
else: raise SystemExit("no key for %r" % ch)
cmd({"execute": "send-key", "arguments": {"keys": [{"type": "qcode", "data": k} for k in keys]}})
time.sleep(0.03)