whatisgithub

What is xdotool?

jordansissel/xdotool — explained in plain English

Analysis updated 2026-06-26

3,792CAudience · developerComplexity · 2/5Setup · easy

In one sentence

xdotool is a Linux command-line tool that scripts mouse clicks, keyboard input, and window management through X11, letting you automate desktop interactions from a terminal or shell script.

Mindmap

mindmap
  root((xdotool))
    What it does
      Simulate keystrokes
      Click and move mouse
      Manage windows
      Script desktop actions
    Tech stack
      C language
      X11 windowing
      libxdo library
      Make build system
    Use cases
      Desktop automation
      GUI testing
      Batch window resize
      Shell scripting
    Audience
      Linux power users
      Automation scripters
      QA testers
      Developers
    Limits
      X11 only
      No Wayland support
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Automate repetitive desktop tasks like typing text or clicking buttons from a shell script without touching the mouse or keyboard.

USE CASE 2

Resize or reposition multiple open windows at once using a single terminal command.

USE CASE 3

Simulate keyboard shortcuts and mouse actions to test desktop GUI applications automatically.

USE CASE 4

Search for specific open windows by name and bring them to the foreground or move them to a different virtual desktop.

What is it built with?

CX11libxdoMakeHomebrewMacPorts

How does it compare?

jordansissel/xdotoolopenkinect/libfreenectraspberrypi/pico-examples
Stars3,7923,7943,794
LanguageCCC
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Install via your Linux package manager (apt, dnf, pacman) or via Homebrew on macOS. Building from source needs X11 dev libraries and make. Does not work on Wayland desktops.

License not mentioned in the explanation.

So what is it?

xdotool is a command-line program for Linux that lets you script mouse and keyboard actions as if a real person were performing them. You can use it to type text, press keyboard shortcuts, click the mouse, move the cursor, and manage application windows, all from a terminal or a shell script. Under the hood it works through X11, the older windowing system that most traditional Linux desktops run on. The window management side of xdotool covers quite a bit of ground. You can search for windows by name or class, resize them in bulk, bring them to the foreground, hide them, change their titles, and move them between virtual desktops if your window manager supports it. For example, a single xdotool command can find every visible terminal window on screen and resize them all to a fixed dimension at once. Beyond the command-line tool, the repository also includes libxdo, a C library that exposes the same functionality so other programs can automate input and window operations programmatically. One important limitation: xdotool only works on systems using X11. If your desktop is running on Wayland, which is the newer graphics system replacing X11 on many modern Linux distributions, most xdotool features including typing and window searching will not work. The README notes alternative tools that work under Wayland using a different approach. Installation is available through the package manager on most major Linux distributions and on macOS via Homebrew or MacPorts. Building from source requires a handful of X11 development libraries and a standard make command. The project has been around for many years and is widely used in automation scripts and testing setups.

Copy-paste prompts

Prompt 1
I want to use xdotool to automatically type a block of text into whichever window is currently focused. Write me a shell script that does this.
Prompt 2
Using xdotool, write a bash script that finds all open terminal windows on my Linux desktop and resizes them all to 800x600 pixels.
Prompt 3
Show me an xdotool command that simulates pressing Ctrl+C in a specific application window found by its title.
Prompt 4
Write a shell script using xdotool that moves the mouse to coordinates (500, 300) and performs a left click, then waits one second and presses the Enter key.
Prompt 5
How do I use the libxdo C library from xdotool in my own C program to simulate a mouse click at a given screen position? Show me example code.

Frequently asked questions

What is xdotool?

xdotool is a Linux command-line tool that scripts mouse clicks, keyboard input, and window management through X11, letting you automate desktop interactions from a terminal or shell script.

What language is xdotool written in?

Mainly C. The stack also includes C, X11, libxdo.

What license does xdotool use?

License not mentioned in the explanation.

How hard is xdotool to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is xdotool for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.