feat(screenshot): auto login past sddm and press Super key to capture Start menu open
This commit is contained in:
1 parent
0a3306216b
commit
da36a897e8
2 files changed
+28
-15
No files matched your search
@@ -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
|
||||
|
||||
+13
-7
@@ -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)
|
||||
Reference in new issue
Block a user