mirror of
https://github.com/theupriser/steamify-cachyos-dev.git
synced 2026-10-05 12:45:56 +02:00
docs: steam-machine-iso: live-session quirks; scripts/qmptype.py types into the VM
This commit is contained in:
1 parent
8ce2917c0f
commit
471332e20f
2 files changed
+35
No files matched your search
@@ -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.
|
||||||
@@ -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)
|
||||||
Reference in new issue
Block a user