LinuxAlternative

Linux · System Tools

wtype

A command-line utility for simulating keyboard input and mouse actions on Wayland compositors.

Código abiertoGratis
Sé el primero en valorar
Licencia
MIT
Última versión
0.5

¿Qué es 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 para: Automating simple keyboard inputs in Wayland-based desktop environments.

Funciones clave de 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

Ventajas

  • Essential for Wayland automation where xdotool fails
  • Simple syntax that is easy to learn
  • Well-maintained with broad distribution support
  • Low resource usage

Inconvenientes

  • 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

Programas de Windows que sustituye wtype

Cómo instalar wtype en Linux

Ubuntu / Mintsudo apt install wtype
Debiansudo apt install wtype
Fedorasudo dnf install wtype
Arch / Manjarosudo pacman -S wtype
openSUSEsudo zypper install wtype

Consejos para usuarios de Windows

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: preguntas frecuentes

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.

Actualizado el