xdotool(1) - command-line X11 automation tool
--window window
    Send keystrokes to a specific window id. You can use "WINDOW STACK" references like "%1" and "%@"
    here. If there is a window stack, then "%1" is the default, otherwise the current window is used.

    See also: "SENDEVENT NOTES" and "WINDOW STACK"
--clearmodifiers
    Clear modifiers before sending keystrokes. See CLEARMODIFIERS below.
--delay milliseconds
    Delay between keystrokes. Default is 12ms.
--window windowid
    Send keystrokes to a specific window id. See "SENDEVENT NOTES" below. The default, if no window
    is given, depends on the window stack. If the window stack is empty the current window is typed
    at using XTEST. Otherwise, the default is "%1" (see "WINDOW STACK").
--delay milliseconds
    Delay between keystrokes. Default is 12ms.
--clearmodifiers
    Clear modifiers before sending keystrokes. See CLEARMODIFIERS below.
--window WINDOW
    Specify a window to move relative to. Coordinates 0,0 are at the top left of the window you
    choose.

    "WINDOW STACK" references are valid here, such as %1 and %@. Though, using %@ probably doesn't
    make sense.
--screen SCREEN
    Move the mouse to the specified screen to move to. This is only useful if you have multiple
    screens and ARE NOT using Xinerama.

    The default is the current screen. If you specify --window, the --screen flag is ignored.
--polar
    Use polar coordinates. This makes 'x' an angle (in degrees, 0-360, etc) and 'y' the distance.

    Rotation starts at 'up' (0 degrees) and rotates clockwise: 90 = right, 180 = down, 270 = left.

    The origin defaults to the center of the current screen. If you specify a --window, then the
    origin is the center of that window.
--clearmodifiers
    See CLEARMODIFIERS
    --sync
        After sending the mouse move request, wait until the mouse is actually moved. If no movement is
        necessary, we will not wait. This is useful for scripts that depend on actions being completed
        before moving on.

        Note: We wait until the mouse moves at all, not necessarily that it actually reaches your
        intended destination. Some applications lock the mouse cursor to certain regions of the screen,
        so waiting for any movement is better in the general case than waiting for a specific target.

mousemove_relative [options] x y
    Move the mouse x,y pixels relative to the current position of the mouse cursor.
--polar
    Use polar coordinates. This makes 'x' an angle (in degrees, 0-360, etc) and 'y' the distance.

    Rotation starts at 'up' (0 degrees) and rotates clockwise: 90 = right, 180 = down, 270 = left.
--sync
    After sending the mouse move request, wait until the mouse is actually moved. If no movement is
    necessary, we will not wait. This is useful for scripts that depend on actions being completed
    before moving on.

    Note that we wait until the mouse moves at all, not necessarily that it actually reaches your
    intended destination. Some applications lock the mouse cursor to certain regions of the screen,
    so waiting for any movement is better in the general case than waiting for a specific target.
    --clearmodifiers
        See CLEARMODIFIERS

click [options] button
    Send a click, that is, a mousedown followed by mouseup for the given button with a short delay
    between the two (currently 12ms).

    Buttons generally map this way: Left mouse is 1, middle is 2, right is 3, wheel up is 4, wheel down
    is 5.
--clearmodifiers
    Clear modifiers before clicking. See CLEARMODIFIERS below.
--repeat REPEAT
    Specify how many times to click. Default is 1. For a double-click, use '--repeat 2'
--delay MILLISECONDS
    Specify how long, in milliseconds, to delay between clicks. This option is not used if the
    --repeat flag is set to 1 (default).
    --window WINDOW
        Specify a window to send a click to. See "SENDEVENT NOTES" below for caveats. Uses the current
        mouse position when generating the event.

        The default, if no window is given, depends on the window stack. If the window stack is empty the
        current window is typed at using XTEST. Otherwise, the default is "%1" (see "WINDOW STACK").

mousedown [options] button
    Same as click, except only a mouse down is sent.

mouseup [options] button
    Same as click, except only a mouse up is sent.

getmouselocation [--shell]
    Outputs the x, y, screen, and window id of the mouse cursor. Screen numbers will be nonzero if you
    have multiple monitors and are not using Xinerama.
    --shell
        This makes getmouselocation output shell data you can eval. Example:

         % xdotool getmouselocation --shell
         X=880
         Y=443
         SCREEN=0
         WINDOW=16777250

         % eval $(xdotool getmouselocation --shell)
         % echo $X,$Y
         714,324

behave_screen_edge [options] where command ...
    Bind an action to events when the mouse hits the screen edge or corner.

    Options are:
--delay MILLISECONDS
    Delay in milliseconds before running the command. This allows you to require a given edge or
    corner to be held for a short period before your command will run. If you leave the edge or
    corner before the delay expires then the time will reset.
--quiesce MILLISECONDS
    Delay in milliseconds before the next command will run. This helps prevent accidentally running
    your command extra times; especially useful if you have a very short --delay (like the default of
    0).
--class
    Match against the window class.
--classname
    Match against the window classname.
--maxdepth N
    Set recursion/child search depth. Default is -1, meaning infinite. 0 means no depth, only root
    windows will be searched. If you only want toplevel windows, set maxdepth of 1 (or 2, depending
    on how your window manager does decorations).
--name
    Match against the window name. This is the same string that is displayed in the window titlebar.
--onlyvisible
    Show only visible windows in the results. This means ones with map state IsViewable.
--pid PID
    Match windows that belong to a specific process id. This may not work for some X applications
    that do not set this metadata on its windows.
--screen N
    Select windows only on a specific screen. Default is to search all screens. Only meaningful if
    you have multiple displays and are not using Xinerama.
--desktop N
    Only match windows on a certain desktop. 'N' is a number. The default is to search all desktops.
--limit N
    Stop searching after finding N matching windows. Specifying a limit will help speed up your
    search if you only want a few results.

    The default is no search limit (which is equivalent to '--limit 0')
--title
    DEPRECATED. See --name.
--all
    Require that all conditions be met. For example:

     xdotool search --all --pid 1424 --name "Hello World"

    This will match only windows that have "Hello World" as a name and are owned by pid 1424.
--any
    Match windows that match any condition (logically, 'or'). This is on by default. For example:

     xdotool search --any --pid 1424 --name "Hello World"

    This will match any windows owned by pid 1424 or windows with name "Hello World"
--sync
    Block until there are results. This is useful when you are launching an application want want to
    wait until the application window is visible.  For example:
--shell
    Output values suitable for 'eval' in a shell.
--usehints
    Use window sizing hints (when available) to set width and height.  This is useful on terminals
    for setting the size based on row/column of text rather than pixels.
--sync
    After sending the window size request, wait until the window is actually resized. If no change is
    necessary, we will not wait. This is useful for scripts that depend on actions being completed
    before moving on.
--sync
    After sending the window move request, wait until the window is actually moved. If no movement is
    necessary, we will not wait. This is useful for scripts that depend on actions being completed
    before moving on.
    --relative
        Make movement relative to the current window position.

windowfocus [options] [window]
    Focus a window. If no window is given, %1 is the default. See "WINDOW STACK" and "COMMAND CHAINING"
    for more details.

    Uses XSetInputFocus which may be ignored by some window managers or programs.
    --sync
        After sending the window focus request, wait until the window is actually focused. This is useful
        for scripts that depend on actions being completed before moving on.

windowmap [options] [window]
    Map a window. In X11 terminology, mapping a window means making it visible on the screen. If no
    window is given, %1 is the default. See "WINDOW STACK" and "COMMAND CHAINING" for more details.
    --sync
        After requesting the window map, wait until the window is actually mapped (visible). This is
        useful for scripts that depend on actions being completed before moving on.

windowminimize [options] [window]
    Minimize a window. In X11 terminology, this is called 'iconify.'  If no window is given, %1 is the
    default. See "WINDOW STACK" and "COMMAND CHAINING" for more details.
    --sync
        After requesting the window minimize, wait until the window is actually minimized. This is useful
        for scripts that depend on actions being completed before moving on.

windowraise [window_id=%1]
    Raise the window to the top of the stack. This may not work on all window managers. If no window is
    given, %1 is the default. See "WINDOW STACK" and "COMMAND CHAINING" for more details.

windowreparent [source_window] destination_window
    Reparent a window. This moves the source_window to be a child window of destination_window. If no
    source is given, %1 is the default.  "WINDOW STACK" window references (like %1) are valid for both
    source_window and destination_window See "WINDOW STACK" and "COMMAND CHAINING" for more details.

windowkill [window]
    Kill a window. This action will destroy the window and kill the client controlling it. If no window
    is given, %1 is the default. See WINDOW STACK and "COMMAND CHAINING" for more details.

windowunmap [options] [window_id=%1]
    Unmap a window, making it no longer appear on your screen. If no window is given, %1 is the default.
    See "WINDOW STACK" and "COMMAND CHAINING" for more details.
    --sync
        After requesting the window unmap, wait until the window is actually unmapped (hidden). This is
        useful for scripts that depend on actions being completed before moving on.

set_window [options] [windowid=%1]
    Set properties about a window. If no window is given, %1 is the default. See "WINDOW STACK" and
    "COMMAND CHAINING" for more details.

    Options:
--name newname
    Set window WM_NAME (the window title, usually)
--icon-name newiconname
    Set window WM_ICON_NAME (the window title when minimized, usually)
--role newrole
    Set window WM_WINDOW_ROLE
--classname newclassname
    Set window class name (not to be confused with window class)
--class newclass
    Set window class (not to be confused with window class name)
--overrideredirect value
    Set window's override_redirect value. This value is a hint to the window manager for whether or
    not it should be managed. If the redirect value is 0, then the window manager will draw borders
    and treat this window normally. If the value is 1, the window manager will ignore this window.
--sync
    After sending the window activation, wait until the window is actually activated. This is useful
    for scripts that depend on actions being completed before moving on.
--relative
    Use relative movements instead of absolute. This lets you move relative to the current desktop.
--sync
    Block until the child process exits. The child process exit status is then passed to the parent
    process (xdotool) which copies it.