LinuxAlternative

Linux · Accessories

xdotool

xDotool is a command‑line utility that simulates keyboard and mouse input, window manipulation and event injection on X11.

Open sourceFree
Be the first to rate
License
GPL-3.0
Latest version
4.20260303.1

What is xdotool?

xDotool was first released in 2007 and has become a staple in the Linux community for automating GUI tasks. It works on any X11‑based desktop, making it a reliable replacement for Windows PowerToys’ automation features. The tool is mature, actively maintained, and widely documented in forums and man pages.

The primary audience is power users, developers, and system administrators who need scriptable control over windows and input devices. It is especially useful in headless or remote‑desktop environments where GUI automation is required.

Compared to PowerToys, xDotool feels more low‑level and script‑oriented. It lacks a graphical interface but offers precise control via command syntax, which can be a learning curve for those used to point‑and‑click tools.

Best for: Automating repetitive GUI tasks and scripting window management on X11 desktops.

Key features of xdotool

  • Simulate keyboard keystrokes and mouse clicks
  • Move, resize, and focus windows
  • Send window events like close or minimize
  • Query window properties (size, position, title)
  • Wait for window appearance or disappearance
  • Execute commands after a delay
  • Support for modifiers (Ctrl, Alt, Shift)
  • Integration with shell scripts

Pros

  • Free and open source
  • Cross‑distribution support (Arch, Debian, Fedora, openSUSE, Ubuntu)
  • No GUI required, works in terminal or scripts
  • Extensive documentation and community examples

Cons

  • Only works on X11, not Wayland
  • No built‑in GUI, learning curve for new users
  • Limited error handling in scripts
  • Requires X server running

Windows programs xdotool replaces

How to install xdotool on Linux

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

Tips for Windows users

If you come from PowerToys, remember that xDotool commands are entered in a terminal or a script; there are no file formats to convert. Use "xdotool type" to send text, "xdotool click" for mouse actions, and "xdotool windowactivate" to focus windows. Shortcuts can be scripted, but you’ll need to map them manually in your shell or use tools like "xdotool key" with modifier flags. Workflow shifts from a GUI wizard to a command line interface, so practice with small scripts before automating complex tasks.

xdotool: frequently asked questions

Is xDotool compatible with Wayland?

No, xDotool only works on X11. For Wayland, you’ll need alternatives like "wtype" or "xdotool‑wayland" if available.

How do I install xDotool on Ubuntu?

Run "sudo apt install xdotool" from a terminal. The package is available in the default repositories.

Can xDotool simulate mouse movement?

Yes, use "xdotool mousemove X Y" to move the cursor to coordinates X and Y.

Does xDotool support scripting languages?

It can be called from any language that can execute shell commands, such as Bash, Python, or Perl.

Updated