21

xdotool and xautomation are two command line X11 automation tools. I've used the former for a while and only recently found out about the existence of the latter, and I'm curious to know what someone who used both for a while has to say about them. In particular:

  1. Do they have the same intended usage? It seems so from the man pages but I could be missing some detail.

  2. Are they equally supported in most systems? Or is one more widely used than the other?

  3. Are there things that can be done with one but not the other?

  • 7
    I also use xdotool for simple things (whenever I need something that AutoKey won't do) and wasn't aware of xautomation. Just glancing at the docs, the biggest difference is that xautomation includes tools for "looking" at the gui screen and xdotool does not. I'm going to look into it further because I need that capability. – Joe May 3 '15 at 5:53
9

xdotool is a compiled program, you can use it from anywhere. And it may be pre-installed on your distribution. You orchestrate it with any scripting language. Comes recommended by many, but can get tedious when scripting more elaborate chains.

An example command to be used within any scripting language/shell:

xdotool type "Hello Unix.StackExchange Reader"

More can be found starting here:


XAUT "(formerly X Automation)" is a C Library and a Python module "to programatically simulate keyboard and mouse use, as well as manipulate windows. The inspiration for this came from AutoIt as well as AutoHotkey".

On most recent distros xaut or xautomation should also be available.

An example py script could look like:

import xaut
kbd = xaut.keyboard()
kbd.type("Hello Unix.StackExchange Reader{Return}")

This "forces" you to use Python, but if you do something more elaborate, like wanting to read input from AD or *SQL, you'll probably quickly appreciate the powers python gives you with the ecosystem of useful module it has.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.