KI & Automatisierung / Desktop-Automatisierung / ydotool / Wayland Automatisierung
Zur Navigation springen
Zur Suche springen
Praxis-Guide: ydotool & Wayland Automatisierung
Unter Linux mit Wayland (Gnome/KDE) funktionieren herkömmliche X11-Tools wie xdotool nicht mehr. ydotool emuliert Tastatur-, Maus- und Touch-Eingaben direkt auf uinput-Kernel-Ebene.
🛠️ 1. Installation & Daemon-Setup
# ydotool & ydotoold Daemon installieren
sudo apt update && sudo apt install -y ydotool
# ydotoold Hintergrund-Dienst starten
sudo systemctl enable --now ydotoold
⚡ 2. CLI-Befehle für Tastatur & Maus
# Text eingeben
ydotool type "Hallo Welt!"
# Einzeltaste drücken (z. B. Enter -> Keycode 28)
ydotool key 28:1 28:0
# Maus bewegen (X: 500, Y: 400)
ydotool mousemove -x 500 -y 400
# Linksklick (Button 0x110)
ydotool click 0x110
🐍 3. Python Automatisierungs-Skript (wayland_automation.py)
import subprocess
import time
def type_text(text: str):
subprocess.run(["ydotool", "type", text])
def press_enter():
subprocess.run(["ydotool", "key", "28:1", "28:0"])
if __name__ == "__main__":
print("Starte Eingabe in 3 Sekunden...")
time.sleep(3)
type_text("echo 'Wayland Automatisierung funktioniert!'")
press_enter()
🔗 Verwandte Themen
- ydotool Anleitung – Grundlegende Einführung
- PyAutoGUI Anleitung – GUI-Automatisierung
- Systemd Service Creation – Daemons
- Beste Computer-Use-Agenten für Ubuntu 26.04 (Top 20) – ydotool im Vergleich zu anderen Ubuntu-tauglichen Agenten