xdotool - command-line X11 automation tool
xdotool cmd args...
xdotool lets you programatically (or manually) simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11's XTEST extension and other Xlib functions.
There is some support for Extended Window Manager Hints (aka EWMH or NetWM). See the EXTENDED WINDOW MANAGER HINTS section for more information.
Type a given keystroke. Examples being ``alt+r'', ``Control_L+J'', ``ctrl+alt+n'', ``BackSpace''.
Generally, any valid X Keysym string will work. Multiple keys are separated by '+'. Aliases exist for ``alt'', ``ctrl'', ``shift'', ``super'', and ``meta'' which all map to Foo_L, such as Alt_L and Control_L, etc.
Example: Send the keystroke ``F2'' xdotool key F2
Same as above, except only keydown events are sent.
Same as above, except only keyup events are sent.
Types a series of letters. In order, as fast as possible.
Example: to type 'Hello world!' you would do: xdotool type 'Hello world!'
Move the mouse to the specific X and Y coordinates on the screen
Send 'mouse down' for the given button. 1 == left, 2 == middle, 3 == right, etc.
Send 'mouse up for the given button
Send mousedown followed by mouseup for the given button
Search for windows with titles, names, or classes matching somestring. The output is line-delimited list of X window identifiers
The options available are:
The default options are --title --name --class
Prints the window id of the currently focused window
Set the window size of the given window
The options available are:
Example: To set a terminal to be 80x24 characters, you would use:
xdotool windowsize --usehints windowid 80 24
Move the window to the given position
Focus the window
Map a window. In X11 terminology, mapping a window means making it visible on the screen.
Raise the window to the top of the stack. This may not work on all window managers.
Unmap a window, making it no longer appear on your screen.
These commands follow the EWMH standard. See the section EXTENDED WINDOW MANAGER HINTS for more information.
Activate the window. This command is different from windowfocus: if the window is on another desktop, we will switch to that desktop. It also uses a different method for bringing the window up. I recommend trying this command before using windowfocus, as it will work on more window managers.
Changes the number of desktops or workspaces.
Output the current number of desktops.
Change the current view to the specified desktop.
Output the current desktop in view.
Move a window to a different desktop.
Output the desktop currently containing the given window.
The following pieces of the EWMH standard are supported:
Asks the window manager what is supported
Query and set the current desktop. Support for this enables these commands:
set_desktop, get_desktop.
Query and set what desktop a window is living in. Support for this enables
these commands: set_desktop_for_window, get_desktop_for_window.
Activate a window by asking the window manager to bring it forward. Support for
this enables these commands: windowactivate.
xprop(1), xwininfo(1),
Project site: http://www.semicomplete.com/projects/xdotool
Google Code: http://semicomplete.googlecode.com/
Please send questions to xdotool-users@googlegroups.com. File bugs and feature requests at the following URL:
http://code.google.com/p/semicomplete/issues/list
xdotool was written by Jordan Sissel.
This manual page was written originally by Daniel Kahn Gillmor <dkg-debian.org@fifthhorseman.net> for the Debian project (but may be used by others). It is maintained by Jordan Sissel.