chamesle

chamesle.org: the site of Chamesle, a small Linux distribution
git clone https://github.com/tortr-rs/chamesle
Log | Files | Refs | README

commit fbd14d9ab2d51f7a5ba317e824ae69bb41f3011f
parent 6551da7de01e742220573e5155dead059296bdde
Author: torter <koubbamohamedrayan@gmail.com>
Date:   Thu, 22 Oct 2026 00:09:40 +0000

fastfetch on every edition, keep the vm helper in the tree

Diffstat:
Mtools/pkg/chamesle-base/recipe | 4++--
Atools/vm/mon.py | 27+++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/tools/pkg/chamesle-base/recipe b/tools/pkg/chamesle-base/recipe @@ -1,12 +1,12 @@ name=chamesle-base version=0.2.0 -rel=2 +rel=3 desc="Chamesle system setup: kernel modules at boot, a few small touches" url=https://chamesle.org license=GPL-3.0-or-later source= makedeps="" -depends="kmod sudo" +depends="kmod sudo fastfetch" build() { cp -a . "$pkgdir/" diff --git a/tools/vm/mon.py b/tools/vm/mon.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 +# drive a headless test vm through its qemu monitor socket +# mon.py SOCK "shot FILE.png" | "key KEYS" | "type TEXT" | any monitor command +import socket, sys, time +sock, cmd = sys.argv[1], sys.argv[2] +s = socket.socket(socket.AF_UNIX); s.connect(sock); s.settimeout(2) +def send(c): + s.sendall((c + "\n").encode()); time.sleep(0.15) + try: s.recv(65536) + except socket.timeout: pass +send("") +w, *a = cmd.split(" ", 1) +if w == "shot": + send("screendump %s -f png" % a[0]); time.sleep(0.8) +elif w == "key": + send("sendkey " + a[0]) +elif w == "type": + m = {" ": "spc", "-": "minus", ".": "dot", "/": "slash", ",": "comma", ";": "semicolon", "=": "equal", + "'": "apostrophe", "\\": "backslash", "[": "bracket_left", "]": "bracket_right", "`": "grave_accent", + "~": "shift-grave_accent", "!": "shift-1", "@": "shift-2", "#": "shift-3", "$": "shift-4", "%": "shift-5", + "^": "shift-6", "&": "shift-7", "*": "shift-8", "(": "shift-9", ")": "shift-0", "_": "shift-minus", + "+": "shift-equal", "|": "shift-backslash", ":": "shift-semicolon", '"': "shift-apostrophe", + "<": "shift-comma", ">": "shift-dot", "?": "shift-slash", "{": "shift-bracket_left", "}": "shift-bracket_right"} + for ch in a[0]: + send("sendkey " + (("shift-" + ch.lower()) if ch.isupper() else m.get(ch, ch))) +else: + send(cmd)