Go to file
Jordan Sissel 33092d8a74
Merge pull request #446 from eli-schwartz/overlinking
Remove unused dependency on libXi
2024-10-15 23:09:02 -07:00
examples Merge pull request #444 from Sachin-Bhat/patch-1 2023-12-24 08:45:24 -08:00
ext/debian - Making .deb packages works now. 2011-01-03 12:13:29 +00:00
t Use `grep -E` instead of `egrep` (#401) 2022-09-13 08:43:04 -07:00
.ghuser.io.json ghuser.io metadata. 2018-07-05 13:01:51 -07:00
.gitignore macos: Fix compile error implicit declaration of function 'strdup' (#425) 2023-04-30 22:46:51 -07:00
.travis.yml Give sudo when make uninstall 2017-03-17 14:05:11 +01:00
CHANGELIST Version bump 2021-10-21 22:44:46 -07:00
COPYRIGHT - 20090609 release 2009-06-09 07:05:51 +00:00
Doxyfile git-svn-id: https://semicomplete.googlecode.com/svn/xdotool@2937 66067f73-fe4c-0410-82e9-b9c6d0c95a22 2010-06-12 08:22:42 +00:00
FAQ.md Use `grep -E` instead of `egrep` (#401) 2022-09-13 08:43:04 -07:00
Makefile Remove unused dependency on libXi 2024-01-17 11:57:52 -05:00
README.md Added link to ydotool (#386) 2023-04-30 22:41:40 -07:00
TODO - add todos 2011-05-30 01:58:03 -07:00
VERSION Version bump 2021-10-21 22:44:46 -07:00
cflags.sh Fix cflags.sh to identify macOS 11 and later (#312) 2021-02-12 23:19:14 -08:00
cmd_behave.c Topic silence warnings (#364) 2021-10-23 22:49:52 -07:00
cmd_behave_screen_edge.c Topic silence warnings (#364) 2021-10-23 22:49:52 -07:00
cmd_click.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_exec.c Topic silence warnings (#364) 2021-10-23 22:49:52 -07:00
cmd_get_desktop.c - Refactor most 'printf' invocations to use xdotool_output which has will 2011-01-02 01:57:32 +00:00
cmd_get_desktop_for_window.c - Refactor most 'printf' invocations to use xdotool_output which has will 2011-01-02 01:57:32 +00:00
cmd_get_desktop_viewport.c - Make xdotool 'get_desktop_viewport' output usable as 2011-03-08 22:46:19 -08:00
cmd_get_display_geometry.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_get_num_desktops.c - Refactor most 'printf' invocations to use xdotool_output which has will 2011-01-02 01:57:32 +00:00
cmd_getactivewindow.c Unified naming convention for all functions of the API 2012-06-07 21:08:03 +02:00
cmd_getmouselocation.c getmouselocation now updates the window stack. (#322) 2021-02-12 23:18:11 -08:00
cmd_getwindowclassname.c Added command getwindowclassname (#247) 2021-02-12 23:51:45 -08:00
cmd_getwindowfocus.c Unified naming convention for all functions of the API 2012-06-07 21:08:03 +02:00
cmd_getwindowgeometry.c Added few options for better usage with eval 2016-08-04 17:26:23 -07:00
cmd_getwindowname.c Removed all signed/unsigned conflicts 2012-05-23 00:50:39 +02:00
cmd_getwindowpid.c Unified naming convention for all functions of the API 2012-06-07 21:08:03 +02:00
cmd_key.c Fixed 'type' --window to use default %1 as manpage stated 2016-09-03 03:59:31 -04:00
cmd_mousedown.c Topic silence warnings (#364) 2021-10-23 22:49:52 -07:00
cmd_mousemove.c Fix bug: Only wait if the mouse cursor was moved. #463 2024-06-20 09:04:08 -07:00
cmd_mousemove_relative.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_mouseup.c Topic silence warnings (#364) 2021-10-23 22:49:52 -07:00
cmd_search.c Topic silence warnings (#364) 2021-10-23 22:49:52 -07:00
cmd_set_desktop.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_set_desktop_for_window.c - consume argument 2010-06-19 21:35:48 +00:00
cmd_set_desktop_viewport.c - Add xdo_get_desktop_viewport and xdo_set_desktop_viewport. 2010-07-06 06:45:28 +00:00
cmd_set_num_desktops.c - Make getopt stop processing as soon as the first non-option argument is 2010-06-13 09:36:44 +00:00
cmd_set_window.c Unified naming convention for all functions of the API 2012-06-07 21:08:03 +02:00
cmd_sleep.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_type.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_window_select.c Unified naming convention for all functions of the API 2012-06-07 21:08:03 +02:00
cmd_windowactivate.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_windowclose.c New feature to close windows. 2015-05-17 15:42:04 -07:00
cmd_windowfocus.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_windowkill.c Unified naming convention for all functions of the API 2012-06-07 21:08:03 +02:00
cmd_windowlower.c Add 'windowlower' command (#426) 2023-05-01 11:03:12 -07:00
cmd_windowmap.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_windowminimize.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_windowmove.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_windowquit.c Add windowquit option and get tests working (#306) 2021-02-12 23:31:46 -08:00
cmd_windowraise.c Unified naming convention for all functions of the API 2012-06-07 21:08:03 +02:00
cmd_windowreparent.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_windowsize.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_windowstate.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
cmd_windowunmap.c Fix compiler warnings. (#344) 2021-08-03 17:11:43 -07:00
patch_clock_gettime.h Only inject a custom clock_gettime if we need to. 2016-08-02 16:50:43 -07:00
pc.sh generate and install a pkgconfig file on make install (#229) 2021-02-12 23:53:44 -08:00
platform.sh patch build system for compilation on CYGWIN (CYGWIN_NT-10.0-19042) - confirmed on x64_64 arch. (#392) 2022-06-29 22:07:25 -07:00
version.sh Detect if the X server is XWayland and report an error. (#342) 2021-08-02 17:10:14 -07:00
xdo.c Merge pull request #446 from eli-schwartz/overlinking 2024-10-15 23:09:02 -07:00
xdo.h Add 'windowlower' command (#426) 2023-05-01 11:03:12 -07:00
xdo_cmd.h Topic silence warnings (#364) 2021-10-23 22:49:52 -07:00
xdo_search.c Fix race condition in search command (#335) 2021-07-16 23:38:26 -07:00
xdo_util.h Add key names "return" and "enter" mapping to 'Return' keysym 2021-08-03 16:48:06 -07:00
xdo_version.h Version bump 2021-10-21 22:44:46 -07:00
xdotool.c Add 'windowlower' command (#426) 2023-05-01 11:03:12 -07:00
xdotool.h Add 'windowlower' command (#426) 2023-05-01 11:03:12 -07:00
xdotool.pod Add 'windowlower' command (#426) 2023-05-01 11:03:12 -07:00

README.md

xdotool - x11 automation tool

xdotool lets you simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11s XTEST extension and other Xlib functions.

⚠ Note: If you are using Wayland, please be aware this software will not work correctly. See the 'Wayland' section below for more detail.

With xdotool, you can search for windows and move, resize, hide, and modify window properties like the title. If your window manager supports it, you can use xdotool to switch desktops, move windows between desktops, and change the number of desktops.

Also in this repository is libxdo, a C library for doing the same.

You may view the user documentation in xdotool.pod

Installation

You may find xdotool in your distribution packaging:

  • Debian and Ubuntu: apt-get install xdotool
  • Fedora: dnf install xdotool
  • FreeBSD: pkg install xdotool
  • macOS: brew install xdotool or sudo port install xdotool
  • OpenSUSE: zypper install xdotool

Basic Usage

Typing

From your terminal, run:

xdotool type "Hello world"

Sending keys

xdotool key ctrl+l

The above will simulate the keystrokes as if you pressed the control key, then the "L" key, and then released both. This is useful for simulating hotkeys.

Closing a window

xdotool selectwindow windowclose

This will close the first window you click on.

Cool Tricks

Bring up Firefox and focus the URL bar

xdotool search "Mozilla Firefox" windowactivate --sync key --clearmodifiers ctrl+l

Resize all visible gnome-terminal windows

xdotool search --onlyvisible --classname "gnome-terminal" windowsize %@ 500
500

Wayland

Wayland is a very different graphics system than X11 (which you might know as Xorg or X). Wayland has some X11 compatibility, but for the purposes of xdotool, many things do not work correctly. Typing, window searching, and many other functions of xdotool do not work, and it is unclear if they could ever work.

Some other tools that might help you if you use Wayland are:

  • ydotool - a tool for sending mouse and keyboard events using Linux's uinput sytem
  • dotool - a tool for sending mouse and keyboard events using Linux's uinput sytem

Building / Compiling

Prerequisites:

  • X11 libraries: xlib, xtst, xi, xkbcommon, xinerama

How to compile and install:

  • Compile: make
  • Install: make install
  • Remove: make uninstall

You may have to set 'PREFIX' to the location you want to install to. The default PREFIX is /usr/local

For packagers, there's also support for DESTDIR for staged install.

Also, see the manpage, which you can generate by running:

  make showman

Note: the manpage will be installed during 'make install'