Simulate keyboard and mouse input on X11 Linux desktops with xdotool
domain: desktop-automation · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Find target windows with `xdotool search --name "<pattern>"`, which matches window titles/names/classes/roles using case-insensitive POSIX extended regular expressions by default
Bring a found window to the front with `xdotool windowactivate <windowid>` — preferred over `windowfocus` because it works across more window managers and can switch virtual desktops to reach the window
Confirm what's frontmost with `xdotool getactivewindow`, described in the docs as more reliable than `getwindowfocus`
Send keystrokes to a specific window with `xdotool key --window <windowid> <keystroke>`, and type literal text with `xdotool type --window <windowid> "text"`
Tune `--delay` (milliseconds between synthetic events, 12ms default for `type`) if fast automated input drops characters in the target app
Add `--clearmodifiers` to `key`/`type` when a stuck modifier key from a prior action is corrupting the simulated input
Known gotchas
xdotool works via X11's XTEST extension and Xlib calls — it has no Wayland support and will not function on a pure Wayland session without an XWayland-compatible target
The tool's own bug notes flag that typing unusual symbols under non-US keyboard layouts can occasionally send the wrong character — verify non-ASCII text input against the actual target layout
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?