Wayland-native command-line automation tool
Find a file
Oskar Rochowiak f796d6ba0f
update url
2026-02-10 14:20:26 +01:00
nix update url 2026-02-10 14:20:26 +01:00
src fix --help message, Resolves #3 2026-01-03 12:07:48 +01:00
.envrc init 2025-09-29 19:05:13 +02:00
.gitignore nix package 2025-09-30 01:21:20 +02:00
.ignore init 2025-09-29 19:05:13 +02:00
Cargo.lock stdin implemented 2025-10-05 20:21:32 +02:00
Cargo.toml enable xdp by default 2025-12-08 12:51:49 +01:00
flake.lock update url 2026-02-10 14:20:26 +01:00
flake.nix update url 2026-02-10 14:20:26 +01:00
LICENSE readme 2025-09-29 23:45:08 +02:00
README.md Add build instructions, Resolves #2 2026-01-03 12:24:58 +01:00

whydotool

A Wayland-native command-line automation tool.

Inspired by ydotool, it simulates keyboard and mouse input using native Wayland protocols.

Features

  • click - simulate mouse button presses
  • mousemove - Move the pointer (relative or absolute)
  • type - type strings of text
  • key- press and release individual keys
  • stdin - stream key events from standard input in real time
  • no root required
  • no daemon required

Requirements

whydotool works on most major Wayland compositors via either:

  • Native Wayland protocols

  • xdg-desktop-portal RemoteDesktop interface

Protocol Support

Keyboard input (key, type, stdin):

Pointer input (click, mousemove):

Universal alternative: If your compositor doesnt support the above protocols, whydotool can use the xdg-desktop-portal RemoteDesktop interface. See the list of supported backends

If your compositor doesn't support the specific protocols above, it will likely work through the portal interface. Check the linked compatibility tables to verify support for your compositor.

Build

Clone the repository and enter it:

git clone https://forgejo.r0chd.pl/r0chd/whydotool
cd whydotool

To build with the default configuration:

cargo build --release

To explicitly disable portal support:

cargo build --no-default-features --release

Disabling portal support reduces dependencies and binary size, but limits compatibility to compositors that implement the native virtual input protocols.

After building binary can be found at ./target/release/whydotool

Examples

Type text:

whydotool type "Hello Wayland"

Press a key:

whydotool key 56:1 62:1 62:0 56:0

Relatively move mouse pointer by -100,100:

whydotool mousemove -x -100 -y 100

Move mouse pointer to 100,100:

whydotool mousemove --absolute -x 100 -y 100

Mouse right click:

whydotool click 0xC1

Mouse repeating left click:

whydotool click --repeat 5 --next-delay 25 0xC0

whydotool vs. ydotool

Feature whydotool ydotool
Compatibility Wayland only Runs everywhere
Security Model Uses compositor-granted Wayland protocols or xdg-desktop-portal Writes directly to uinput
Privileges Does not require root Requires root privileges
Daemon Daemonless Requires a running daemon