Linux · System Tools
wtype
A command-line utility for simulating keyboard input and mouse actions on Wayland compositors.
- Lizenz
- MIT
- Aktuelle Version
- 0.5
Was ist wtype?
wtype is a lightweight CLI tool designed specifically for the Wayland display protocol. Unlike X11 tools, it cannot simply inject events globally; instead, it uses the virtual keyboard protocol to send keystrokes to the focused window. It is a mature project with stable releases across major distributions, serving as a necessary bridge for automation scripts in modern Linux desktops.
This tool is for developers, system administrators, and power users who need to automate GUI interactions on Wayland. If you rely on scripts to fill forms, test applications, or manage window states, wtype provides the low-level input simulation required. It is not a full scripting environment but a precise utility for sending specific key sequences.
Compared to AutoHotkey, wtype is significantly more limited. AutoHotkey offers a rich language for complex logic, hotkeys, and UI modifications, while wtype is strictly for input simulation. You will not find built-in timers, loops, or GUI control in wtype. It feels like using xdotool on X11, but with the necessary adaptations for Wayland’s security model, requiring you to handle logic externally in bash or Python.
Ideal für: Automating simple keyboard inputs in Wayland-based desktop environments.
Wichtige Funktionen von wtype
- Simulates keyboard input on Wayland
- Supports key combinations and sequences
- Works with most modern Wayland compositors (GNOME, KDE, Sway)
- Command-line interface for scripting
- No global event hooking required
- Lightweight and dependency-free
- Compatible with Arch, Debian, Fedora, openSUSE, Ubuntu
Vorteile
- Essential for Wayland automation where xdotool fails
- Simple syntax that is easy to learn
- Well-maintained with broad distribution support
- Low resource usage
Nachteile
- Cannot capture or monitor input, only send it
- Lacks built-in scripting logic (loops, conditions)
- Does not support mouse movement or clicks
- Requires external scripting for complex workflows
Windows-Programme, die wtype ersetzt
wtype unter Linux installieren
sudo apt install wtypesudo apt install wtypesudo dnf install wtypesudo pacman -S wtypesudo zypper install wtypeTipps für Windows-Umsteiger
You cannot directly port AutoHotkey scripts to wtype. AHK scripts often contain logic, UI elements, and mouse actions that wtype does not support. For simple hotkey remapping, consider using your compositor’s native keybinding features (e.g., Sway config, GNOME extensions) instead. For complex automation, write a bash or Python script that calls wtype for the input parts and handles logic separately. Remember that wtype only works on the currently focused window, so ensure your script manages window focus correctly.
wtype: häufige Fragen
Why doesn't wtype work on X11?
wtype is designed for Wayland. For X11, use xdotool, which has broader capabilities including mouse control and window management.
Can wtype move the mouse?
No, wtype only handles keyboard input. For mouse actions on Wayland, you need a different tool like ydotool or a compositor-specific script.
Is wtype safe to use for automating passwords?
It is as safe as any other input simulation tool. However, since it sends keys to the focused window, ensure no sensitive fields are active during unintended runs.
Does wtype work with GNOME?
Yes, it works with GNOME on Wayland, but you may need to ensure the virtual keyboard protocol is enabled in your compositor settings.
Aktualisiert am