| 1 | =pod |
|---|
| 2 | |
|---|
| 3 | =head1 NAME |
|---|
| 4 | |
|---|
| 5 | xdotool - command-line X11 automation tool |
|---|
| 6 | |
|---|
| 7 | =head1 SYNOPSIS |
|---|
| 8 | |
|---|
| 9 | B<xdotool> I<cmd> I<args...> |
|---|
| 10 | |
|---|
| 11 | =head1 DESCRIPTION |
|---|
| 12 | |
|---|
| 13 | B<xdotool> lets you programatically (or manually) simulate keyboard input and |
|---|
| 14 | mouse activity, move and resize windows, etc. It does this using X11's |
|---|
| 15 | XTEST extension and other Xlib functions. |
|---|
| 16 | |
|---|
| 17 | There is some support for Extended Window Manager Hints (aka EWMH or NetWM). |
|---|
| 18 | See the L</EXTENDED WINDOW MANAGER HINTS> section for more information. |
|---|
| 19 | |
|---|
| 20 | =head1 KEYBOARD COMMANDS |
|---|
| 21 | |
|---|
| 22 | =over |
|---|
| 23 | |
|---|
| 24 | =item B<key> I<keystroke> |
|---|
| 25 | |
|---|
| 26 | Type a given keystroke. Examples being "alt+r", "Control_L+J", |
|---|
| 27 | "ctrl+alt+n", "BackSpace". |
|---|
| 28 | |
|---|
| 29 | Generally, any valid X Keysym string will work. Multiple keys are |
|---|
| 30 | separated by '+'. Aliases exist for "alt", "ctrl", "shift", "super", |
|---|
| 31 | and "meta" which all map to Foo_L, such as Alt_L and Control_L, etc. |
|---|
| 32 | |
|---|
| 33 | Example: Send the keystroke "F2" |
|---|
| 34 | xdotool key F2 |
|---|
| 35 | |
|---|
| 36 | =item B<keydown> I<keystroke> |
|---|
| 37 | |
|---|
| 38 | Same as above, except only keydown events are sent. |
|---|
| 39 | |
|---|
| 40 | =item B<keyup> I<keystroke> |
|---|
| 41 | |
|---|
| 42 | Same as above, except only keyup events are sent. |
|---|
| 43 | |
|---|
| 44 | =item B<type> I<something to type> |
|---|
| 45 | |
|---|
| 46 | Types a series of letters. In order, as fast as possible. |
|---|
| 47 | |
|---|
| 48 | Example: to type 'Hello world!' you would do: |
|---|
| 49 | xdotool type 'Hello world!' |
|---|
| 50 | |
|---|
| 51 | =back |
|---|
| 52 | |
|---|
| 53 | =head1 MOUSE COMMANDS |
|---|
| 54 | |
|---|
| 55 | =over |
|---|
| 56 | |
|---|
| 57 | =item B<mousemove> I<x> I<y> |
|---|
| 58 | |
|---|
| 59 | Move the mouse to the specific X and Y coordinates on the screen |
|---|
| 60 | |
|---|
| 61 | =item B<mousedown> I<button> |
|---|
| 62 | |
|---|
| 63 | Send 'mouse down' for the given button. 1 == left, 2 == middle, 3 == right, |
|---|
| 64 | etc. |
|---|
| 65 | |
|---|
| 66 | =item B<mouseup> I<button> |
|---|
| 67 | |
|---|
| 68 | Send 'mouse up for the given button |
|---|
| 69 | |
|---|
| 70 | =item B<click> I<button> |
|---|
| 71 | |
|---|
| 72 | Send mousedown followed by mouseup for the given button |
|---|
| 73 | |
|---|
| 74 | =item B<getmouselocation> |
|---|
| 75 | |
|---|
| 76 | Outputs the x, y, and screen location of the mouse cursor. Screen numbers will be nonzero if you have multiple monitors and are not using Xinerama. |
|---|
| 77 | |
|---|
| 78 | =back |
|---|
| 79 | |
|---|
| 80 | =head1 WINDOW COMMANDS |
|---|
| 81 | |
|---|
| 82 | =over |
|---|
| 83 | |
|---|
| 84 | =item B<search> I<[options]> I<somestring> |
|---|
| 85 | |
|---|
| 86 | Search for windows with titles, names, or classes matching somestring. The |
|---|
| 87 | output is line-delimited list of X window identifiers |
|---|
| 88 | |
|---|
| 89 | The options available are: |
|---|
| 90 | |
|---|
| 91 | =over |
|---|
| 92 | |
|---|
| 93 | =item B<--onlyvisible> - Show only visible windows in the results. |
|---|
| 94 | |
|---|
| 95 | =item B<--title> - Match against the window title |
|---|
| 96 | |
|---|
| 97 | =item B<--name> - Match against the window name |
|---|
| 98 | |
|---|
| 99 | =item B<--class> - Match against the window class |
|---|
| 100 | |
|---|
| 101 | =back |
|---|
| 102 | |
|---|
| 103 | The default options are C<--title --name --class> |
|---|
| 104 | |
|---|
| 105 | =item B<getwindowfocus> |
|---|
| 106 | |
|---|
| 107 | Prints the window id of the currently focused window |
|---|
| 108 | |
|---|
| 109 | =item B<windowsize> [options] windowid width height |
|---|
| 110 | |
|---|
| 111 | Set the window size of the given window |
|---|
| 112 | |
|---|
| 113 | The options available are: |
|---|
| 114 | |
|---|
| 115 | =over |
|---|
| 116 | |
|---|
| 117 | =item B<--usehints> - Use window sizing hints when setting width and height. |
|---|
| 118 | This is useful on terminals. |
|---|
| 119 | |
|---|
| 120 | =back |
|---|
| 121 | |
|---|
| 122 | Example: To set a terminal to be 80x24 characters, you would use: |
|---|
| 123 | C<xdotool windowsize --usehints windowid 80 24> |
|---|
| 124 | |
|---|
| 125 | =item B<windowmove> I<windowid> I<x> I<y> |
|---|
| 126 | |
|---|
| 127 | Move the window to the given position |
|---|
| 128 | |
|---|
| 129 | =item B<windowfocus> I<windowid> |
|---|
| 130 | |
|---|
| 131 | Focus the window |
|---|
| 132 | |
|---|
| 133 | =item B<windowmap> I<window_id> |
|---|
| 134 | |
|---|
| 135 | Map a window. In X11 terminology, mapping a window means making it visible on |
|---|
| 136 | the screen. |
|---|
| 137 | |
|---|
| 138 | =item B<windowraise> I<window_id> |
|---|
| 139 | |
|---|
| 140 | Raise the window to the top of the stack. This may not work on all window managers. |
|---|
| 141 | |
|---|
| 142 | =item B<windowunmap> I<window_id> |
|---|
| 143 | |
|---|
| 144 | Unmap a window, making it no longer appear on your screen. |
|---|
| 145 | |
|---|
| 146 | =back |
|---|
| 147 | |
|---|
| 148 | =head1 DESKTOP AND WINDOW COMMANDS |
|---|
| 149 | |
|---|
| 150 | These commands follow the EWMH standard. See the section L<EXTENDED WINDOW |
|---|
| 151 | MANAGER HINTS> for more information. |
|---|
| 152 | |
|---|
| 153 | =over |
|---|
| 154 | |
|---|
| 155 | =item B<windowactivate> I<windowid> |
|---|
| 156 | |
|---|
| 157 | Activate the window. This command is different from windowfocus: |
|---|
| 158 | if the window is on another desktop, we will switch to that desktop. It also |
|---|
| 159 | uses a different method for bringing the window up. I recommend trying this |
|---|
| 160 | command before using windowfocus, as it will work on more window managers. |
|---|
| 161 | |
|---|
| 162 | =item B<getactivewindow> |
|---|
| 163 | |
|---|
| 164 | Output the current active window. This command is often more reliable than |
|---|
| 165 | getwindowfocus. |
|---|
| 166 | |
|---|
| 167 | =item B<set_num_desktops> I<number> |
|---|
| 168 | |
|---|
| 169 | Changes the number of desktops or workspaces. |
|---|
| 170 | |
|---|
| 171 | =item B<get_num_desktops> |
|---|
| 172 | |
|---|
| 173 | Output the current number of desktops. |
|---|
| 174 | |
|---|
| 175 | =item B<set_desktop> I<desktop_number> |
|---|
| 176 | |
|---|
| 177 | Change the current view to the specified desktop. |
|---|
| 178 | |
|---|
| 179 | =item B<get_desktop> |
|---|
| 180 | |
|---|
| 181 | Output the current desktop in view. |
|---|
| 182 | |
|---|
| 183 | =item B<set_desktop_for_window> I<window_id> I<desktop_number> |
|---|
| 184 | |
|---|
| 185 | Move a window to a different desktop. |
|---|
| 186 | |
|---|
| 187 | =item B<get_desktop_for_window> I<window_id> |
|---|
| 188 | |
|---|
| 189 | Output the desktop currently containing the given window. |
|---|
| 190 | |
|---|
| 191 | =back |
|---|
| 192 | |
|---|
| 193 | =head1 EXTENDED WINDOW MANAGER HINTS |
|---|
| 194 | |
|---|
| 195 | The following pieces of the EWMH standard are supported: |
|---|
| 196 | |
|---|
| 197 | =over |
|---|
| 198 | |
|---|
| 199 | =item _NET_SUPPORTED |
|---|
| 200 | |
|---|
| 201 | Asks the window manager what is supported |
|---|
| 202 | |
|---|
| 203 | =item _NET_CURRENT_DESKTOP |
|---|
| 204 | |
|---|
| 205 | Query and set the current desktop. Support for this enables these commands: |
|---|
| 206 | C<set_desktop>, C<get_desktop>. |
|---|
| 207 | |
|---|
| 208 | =item _NET_WM_DESKTOP |
|---|
| 209 | |
|---|
| 210 | Query and set what desktop a window is living in. Support for this enables |
|---|
| 211 | these commands: C<set_desktop_for_window>, C<get_desktop_for_window>. |
|---|
| 212 | |
|---|
| 213 | =item _NET_ACTIVE_WINDOW |
|---|
| 214 | |
|---|
| 215 | Allows you to query and set the active window by asking the window manager to |
|---|
| 216 | bring it forward. Support for this enables these commands: C<windowactivate>, C<getactivewindow>. |
|---|
| 217 | |
|---|
| 218 | =back |
|---|
| 219 | |
|---|
| 220 | =head1 SEE ALSO |
|---|
| 221 | |
|---|
| 222 | L<xprop(1)>, L<xwininfo(1)>, |
|---|
| 223 | |
|---|
| 224 | Project site: L<http://www.semicomplete.com/projects/xdotool> |
|---|
| 225 | |
|---|
| 226 | Google Code: L<http://semicomplete.googlecode.com/> |
|---|
| 227 | |
|---|
| 228 | =head1 CONTACT |
|---|
| 229 | |
|---|
| 230 | Please send questions to xdotool-users@googlegroups.com. File bugs and feature requests at the following URL: |
|---|
| 231 | |
|---|
| 232 | L<http://code.google.com/p/semicomplete/issues/list> |
|---|
| 233 | |
|---|
| 234 | =head1 AUTHOR |
|---|
| 235 | |
|---|
| 236 | xdotool was written by Jordan Sissel. |
|---|
| 237 | |
|---|
| 238 | This manual page was written originally by Daniel Kahn Gillmor |
|---|
| 239 | E<lt>dkg-debian.org@fifthhorseman.netE<gt> for the Debian project (but may be |
|---|
| 240 | used by others). It is maintained by Jordan Sissel. |
|---|
| 241 | |
|---|
| 242 | =cut |
|---|