From da36a897e8b1b46643c8b182d70a3453e5a8d24b Mon Sep 17 00:00:00 2001 From: Adam Eehan Date: Sun, 25 Oct 2026 02:59:35 +0530 Subject: [PATCH] feat(screenshot): auto login past sddm and press Super key to capture Start menu open --- .github/workflows/screenshot.yml | 23 +++++++++++++++-------- scripts/capture_qemu.py | 20 +++++++++++++------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/screenshot.yml b/.github/workflows/screenshot.yml index 0b0784b..5a88c9e 100644 --- a/.github/workflows/screenshot.yml +++ b/.github/workflows/screenshot.yml @@ -25,7 +25,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y qemu-system-x86 imagemagick - # Unlock KVM hardware acceleration device permissions if [ -e /dev/kvm ]; then sudo chmod 666 /dev/kvm echo "Successfully enabled /dev/kvm hardware virtualization!" @@ -78,16 +77,24 @@ jobs: sleep 30 python3 scripts/capture_qemu.py /tmp/qemu/qmp.sock /tmp/captures/02_kernel_boot.ppm - # Capture 3: Desktop Environment Loading (at 85s) - sleep 50 + # Log into desktop session if on SDDM prompt (at 65s) + sleep 30 + python3 scripts/capture_qemu.py /tmp/qemu/qmp.sock login + + # Capture 3: Desktop Environment with Wallpaper & Dock (at 95s) + sleep 30 python3 scripts/capture_qemu.py /tmp/qemu/qmp.sock /tmp/captures/03_airlys_desktop.ppm - # Capture 4: Fully Settled Desktop with Wallpaper & Dock (at 145s) - sleep 60 - python3 scripts/capture_qemu.py /tmp/qemu/qmp.sock /tmp/captures/04_airlys_desktop_settled.ppm + # Send Super / Windows key to open KDE Start Menu (at 110s) + sleep 15 + python3 scripts/capture_qemu.py /tmp/qemu/qmp.sock start - # Capture 5: Final S1 Desktop with Blur and Dock (at 190s) - sleep 45 + # Capture 4: Full Desktop WITH Start Menu Open & Apps (at 125s) + sleep 15 + python3 scripts/capture_qemu.py /tmp/qemu/qmp.sock /tmp/captures/04_airlys_start_menu.ppm + + # Capture 5: Final Settled System State (at 155s) + sleep 30 python3 scripts/capture_qemu.py /tmp/qemu/qmp.sock /tmp/captures/05_airlys_desktop_final.ppm kill -9 $QEMU_PID || true diff --git a/scripts/capture_qemu.py b/scripts/capture_qemu.py index e6938b4..a1bb2f6 100755 --- a/scripts/capture_qemu.py +++ b/scripts/capture_qemu.py @@ -4,7 +4,7 @@ import time import socket import json -def qmp_send_enter(sock_path): +def qmp_send_keys(sock_path, key_names): try: s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.settimeout(10) @@ -12,13 +12,15 @@ def qmp_send_enter(sock_path): s.recv(4096) s.sendall(json.dumps({"execute": "qmp_capabilities"}).encode() + b"\n") s.recv(4096) - cmd = json.dumps({"execute": "send-key", "arguments": {"keys": [{"type": "qcode", "data": "ret"}]}}) - s.sendall(cmd.encode() + b"\n") - s.recv(4096) + for k in key_names: + cmd = json.dumps({"execute": "send-key", "arguments": {"keys": [{"type": "qcode", "data": k}]}}) + s.sendall(cmd.encode() + b"\n") + s.recv(4096) + time.sleep(0.1) s.close() - print("Sent Enter key to boot menu successfully.") + print(f"Sent keys {key_names} successfully.") except Exception as e: - print(f"Failed to send Enter key: {e}") + print(f"Failed to send keys: {e}") def qmp_screendump(sock_path, out_file): try: @@ -43,6 +45,10 @@ if __name__ == "__main__": sock = sys.argv[1] arg = sys.argv[2] if arg == "enter": - qmp_send_enter(sock) + qmp_send_keys(sock, ["ret"]) + elif arg == "login": + qmp_send_keys(sock, ["a", "i", "r", "l", "y", "s", "ret"]) + elif arg == "start" or arg == "super": + qmp_send_keys(sock, ["meta_l"]) else: qmp_screendump(sock, arg)