xdo

Undocumented in source.

Members

Aliases

charcodemap_t
alias charcodemap_t = charcodemap
Undocumented in source.
xdo_search_t
alias xdo_search_t = xdo_search
Undocumented in source.
xdo_t
alias xdo_t = xdo
Undocumented in source.

Enums

XDO_FEATURES
enum XDO_FEATURES
Undocumented in source.

Functions

xdo_activate_window
int xdo_activate_window(xdo_t* xdo, Window wid)

Activate a window. This is generally a better choice than xdo_focus_window for a variety of reasons, but it requires window manager support: - If the window is on another desktop, that desktop is switched to. - It moves the window forward rather than simply focusing it

xdo_clear_active_modifiers
int xdo_clear_active_modifiers(xdo_t* xdo, Window window, charcodemap_t* active_mods, int active_mods_n)

Send any events necessary to clear the active modifiers. For example, if you are holding 'alt' when xdo_get_active_modifiers is called, then this method will send a key-up for 'alt'

xdo_click_window
int xdo_click_window(xdo_t* xdo, Window window, int button)

Send a click for a specific mouse button at the current mouse location.

xdo_click_window_multiple
int xdo_click_window_multiple(xdo_t* xdo, Window window, int button, int repeat, useconds_t delay)

Send a one or more clicks for a specific mouse button at the current mouse location.

xdo_close_window
int xdo_close_window(xdo_t* xdo, Window window)

Close a window without trying to kill the client.

xdo_disable_feature
void xdo_disable_feature(xdo_t* xdo, int feature)

Disable an xdo feature.

xdo_enable_feature
void xdo_enable_feature(xdo_t* xdo, int feature)

Enable an xdo feature.

xdo_enter_text_window
int xdo_enter_text_window(xdo_t* xdo, Window window, char* string, useconds_t delay)

Type a string to the specified window.

xdo_find_window_client
int xdo_find_window_client(xdo_t* xdo, Window window, Window* window_ret, int direction)

Find a client window (child) in a given window. Useful if you get the window manager's decorator window rather than the client window.

xdo_focus_window
int xdo_focus_window(xdo_t* xdo, Window wid)

Focus a window.

xdo_free
void xdo_free(xdo_t* xdo)

Free and destroy an xdo_t instance.

xdo_get_active_keys_to_keycode_list
int xdo_get_active_keys_to_keycode_list(xdo_t* xdo, charcodemap_t** keys, int* nkeys)

Get a list of active keys. Uses XQueryKeymap.

xdo_get_active_modifiers
int xdo_get_active_modifiers(xdo_t* xdo, charcodemap_t** keys, int* nkeys)

Get a list of active keys. Uses XQueryKeymap.

xdo_get_active_window
int xdo_get_active_window(xdo_t* xdo, Window* window_ret)

Get the currently-active window. Requires your window manager to support this. Uses _NET_ACTIVE_WINDOW from the EWMH spec.

xdo_get_current_desktop
int xdo_get_current_desktop(xdo_t* xdo, long* desktop)

Get the current desktop. Uses _NET_CURRENT_DESKTOP of the EWMH spec.

xdo_get_desktop_for_window
int xdo_get_desktop_for_window(xdo_t* xdo, Window wid, long* desktop)

Get the desktop a window is on. Uses _NET_WM_DESKTOP of the EWMH spec.

xdo_get_desktop_viewport
int xdo_get_desktop_viewport(xdo_t* xdo, int* x_ret, int* y_ret)

Get the position of the current viewport.

xdo_get_focused_window
int xdo_get_focused_window(xdo_t* xdo, Window* window_ret)

Get the window currently having focus.

xdo_get_focused_window_sane
int xdo_get_focused_window_sane(xdo_t* xdo, Window* window_ret)

Like xdo_get_focused_window, but return the first ancestor-or-self window * having a property of WM_CLASS. This allows you to get the "real" or top-level-ish window having focus rather than something you may not expect to be the window having focused.

xdo_get_input_state
uint xdo_get_input_state(xdo_t* xdo)

Get the current input state. This is a mask value containing any of the following: ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, or Mod5Mask.

xdo_get_mouse_location
int xdo_get_mouse_location(xdo_t* xdo, int* x, int* y, int* screen_num)

Get the current mouse location (coordinates and screen number).

xdo_get_mouse_location2
int xdo_get_mouse_location2(xdo_t* xdo, int* x_ret, int* y_ret, int* screen_num_ret, Window* window_ret)

Get all mouse location-related data.

xdo_get_number_of_desktops
int xdo_get_number_of_desktops(xdo_t* xdo, long* ndesktops)

Get the current number of desktops. Uses _NET_NUMBER_OF_DESKTOPS of the EWMH spec.

xdo_get_pid_window
int xdo_get_pid_window(xdo_t* xdo, Window window)

Get the PID owning a window. Not all applications support this. It looks at the _NET_WM_PID property of the window.

xdo_get_symbol_map
char** xdo_get_symbol_map()

If you need the symbol map, use this method.

xdo_get_viewport_dimensions
int xdo_get_viewport_dimensions(xdo_t* xdo, uint* width, uint* height, int screen)

Query the viewport (your display) dimensions

xdo_get_window_at_mouse
int xdo_get_window_at_mouse(xdo_t* xdo, Window* window_ret)

Get the window the mouse is currently over

xdo_get_window_location
int xdo_get_window_location(xdo_t* xdo, Window wid, int* x_ret, int* y_ret, Screen** screen_ret)

Get a window's location.

xdo_get_window_name
int xdo_get_window_name(xdo_t* xdo, Window window, ubyte** name_ret, int* name_len_ret, int* name_type)

Get a window's name, if any.

xdo_get_window_property
int xdo_get_window_property(xdo_t* xdo, Window window, char* property, ubyte** value, long* nitems, Atom* type, int* size)

Get property of window by name of atom.

xdo_get_window_property_by_atom
ubyte* xdo_get_window_property_by_atom(xdo_t* xdo, Window window, Atom atom, long* nitems, Atom* type, int* size)

Generic property fetch.

xdo_get_window_size
int xdo_get_window_size(xdo_t* xdo, Window wid, uint* width_ret, uint* height_ret)

Get a window's size.

xdo_has_feature
int xdo_has_feature(xdo_t* xdo, int feature)

Check if a feature is enabled.

xdo_kill_window
int xdo_kill_window(xdo_t* xdo, Window window)

Kill a window and the client owning it.

xdo_map_window
int xdo_map_window(xdo_t* xdo, Window wid)

Map a window. This mostly means to make the window visible if it is not currently mapped.

xdo_minimize_window
int xdo_minimize_window(xdo_t* xdo, Window wid)

Minimize a window.

xdo_mouse_down
int xdo_mouse_down(xdo_t* xdo, Window window, int button)

Send a mouse press (aka mouse down) for a given button at the current mouse location.

xdo_mouse_up
int xdo_mouse_up(xdo_t* xdo, Window window, int button)

Send a mouse release (aka mouse up) for a given button at the current mouse location.

xdo_move_mouse
int xdo_move_mouse(xdo_t* xdo, int x, int y, int screen)

Move the mouse to a specific location.

xdo_move_mouse_relative
int xdo_move_mouse_relative(xdo_t* xdo, int x, int y)

Move the mouse relative to it's current position.

xdo_move_mouse_relative_to_window
int xdo_move_mouse_relative_to_window(xdo_t* xdo, Window window, int x, int y)

Move the mouse to a specific location relative to the top-left corner of a window.

xdo_move_window
int xdo_move_window(xdo_t* xdo, Window wid, int x, int y)

Move a window to a specific location.

xdo_new
xdo_t* xdo_new(char* display)

Create a new xdo_t instance.

xdo_new_with_opened_display
xdo_t* xdo_new_with_opened_display(Display* xdpy, char* display, int close_display_when_freed)

Create a new xdo_t instance with an existing X11 Display instance.

xdo_raise_window
int xdo_raise_window(xdo_t* xdo, Window wid)

Raise a window to the top of the window stack. This is also sometimes termed as bringing the window forward.

xdo_reparent_window
int xdo_reparent_window(xdo_t* xdo, Window wid_source, Window wid_target)

Reparents a window

xdo_search_windows
int xdo_search_windows(xdo_t* xdo, xdo_search_t* search, Window** windowlist_ret, uint* nwindows_ret)

Search for windows.

xdo_select_window_with_click
int xdo_select_window_with_click(xdo_t* xdo, Window* window_ret)

Get a window ID by clicking on it. This function blocks until a selection is made.

xdo_send_keysequence_window
int xdo_send_keysequence_window(xdo_t* xdo, Window window, char* keysequence, useconds_t delay)

Send a keysequence to the specified window.

xdo_send_keysequence_window_down
int xdo_send_keysequence_window_down(xdo_t* xdo, Window window, char* keysequence, useconds_t delay)

Send key press (down) events for the given key sequence.

xdo_send_keysequence_window_list_do
int xdo_send_keysequence_window_list_do(xdo_t* xdo, Window window, charcodemap_t* keys, int nkeys, int pressed, int* modifier, useconds_t delay)

Send a series of keystrokes.

xdo_send_keysequence_window_up
int xdo_send_keysequence_window_up(xdo_t* xdo, Window window, char* keysequence, useconds_t delay)

Send key release (up) events for the given key sequence.

xdo_set_active_modifiers
int xdo_set_active_modifiers(xdo_t* xdo, Window window, charcodemap_t* active_mods, int active_mods_n)

Send any events necessary to make these modifiers active. This is useful if you just cleared the active modifiers and then wish to restore them after.

xdo_set_current_desktop
int xdo_set_current_desktop(xdo_t* xdo, long desktop)

Switch to another desktop. Uses _NET_CURRENT_DESKTOP of the EWMH spec.

xdo_set_desktop_for_window
int xdo_set_desktop_for_window(xdo_t* xdo, Window wid, long desktop)

Move a window to another desktop Uses _NET_WM_DESKTOP of the EWMH spec.

xdo_set_desktop_viewport
int xdo_set_desktop_viewport(xdo_t* xdo, int x, int y)

Set the position of the current viewport.

xdo_set_number_of_desktops
int xdo_set_number_of_desktops(xdo_t* xdo, long ndesktops)

Set the number of desktops. Uses _NET_NUMBER_OF_DESKTOPS of the EWMH spec.

xdo_set_window_class
int xdo_set_window_class(xdo_t* xdo, Window wid, char* name, char* _class)

Change the window's classname and or class.

xdo_set_window_override_redirect
int xdo_set_window_override_redirect(xdo_t* xdo, Window wid, int override_redirect)

Set the override_redirect value for a window. This generally means whether or not a window manager will manage this window.

xdo_set_window_property
int xdo_set_window_property(xdo_t* xdo, Window wid, char* property, char* value)

Change a window property.

xdo_set_window_size
int xdo_set_window_size(xdo_t* xdo, Window wid, int w, int h, int flags)

Change the window size.

xdo_set_window_urgency
int xdo_set_window_urgency(xdo_t* xdo, Window wid, int urgency)

Sets the urgency hint for a window.

xdo_translate_window_with_sizehint
int xdo_translate_window_with_sizehint(xdo_t* xdo, Window window, uint width, uint height, uint* width_ret, uint* height_ret)

Apply a window's sizing hints (if any) to a given width and height.

xdo_unmap_window
int xdo_unmap_window(xdo_t* xdo, Window wid)

Unmap a window

xdo_version
char* xdo_version()

Return a string representing the version of this library

xdo_wait_for_mouse_move_from
int xdo_wait_for_mouse_move_from(xdo_t* xdo, int origin_x, int origin_y)

Wait for the mouse to move from a location. This function will block until the condition has been satisfied.

xdo_wait_for_mouse_move_to
int xdo_wait_for_mouse_move_to(xdo_t* xdo, int dest_x, int dest_y)

Wait for the mouse to move to a location. This function will block until the condition has been satisfied.

xdo_wait_for_window_active
int xdo_wait_for_window_active(xdo_t* xdo, Window window, int active)

Wait for a window to be active or not active.

xdo_wait_for_window_focus
int xdo_wait_for_window_focus(xdo_t* xdo, Window window, int want_focus)

Wait for a window to have or lose focus.

xdo_wait_for_window_map_state
int xdo_wait_for_window_map_state(xdo_t* xdo, Window wid, int map_state)

Wait for a window to have a specific map state.

xdo_wait_for_window_size
int xdo_wait_for_window_size(xdo_t* xdo, Window window, uint width, uint height, int flags, int to_or_from)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Manifest constants

CURRENTWINDOW
enum CURRENTWINDOW;

CURRENTWINDOW is a special identify for xdo input faking (mouse and keyboard) functions like xdo_send_keysequence_window that indicate we should target the current window, not a specific window.

SEARCH_CLASS
enum SEARCH_CLASS;

Search only window class. @see xdo_search_windows

SEARCH_CLASSNAME
enum SEARCH_CLASSNAME;

Search only window class name. @see xdo_search

SEARCH_DESKTOP
enum SEARCH_DESKTOP;

Search a specific desktop @see xdo_search.screen @see xdo_search_windows

SEARCH_NAME
enum SEARCH_NAME;

Search only window name. @see xdo_search_windows

SEARCH_ONLYVISIBLE
enum SEARCH_ONLYVISIBLE;

Search only visible windows. @see xdo_search_windows

SEARCH_PID
enum SEARCH_PID;

Search only window pid. @see xdo_search_windows

SEARCH_SCREEN
enum SEARCH_SCREEN;

Search only a specific screen. @see xdo_search.screen @see xdo_search_windows

SEARCH_TITLE
enum SEARCH_TITLE;

Search only window title. DEPRECATED - Use SEARCH_NAME @see xdo_search_windows

SIZE_FROM
enum SIZE_FROM;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SIZE_TO
enum SIZE_TO;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SIZE_USEHINTS
enum SIZE_USEHINTS;
SIZE_USEHINTS_X
enum SIZE_USEHINTS_X;
SIZE_USEHINTS_Y
enum SIZE_USEHINTS_Y;

When issuing a window size change, giving this flag will make the size change be relative to the size hints of the window. For terminals, this generally means that the window size will be relative to the font size, allowing you to change window sizes based on character rows and columns instead of pixels.

XDO_ERROR
enum XDO_ERROR;
Undocumented in source.
XDO_FIND_CHILDREN
enum XDO_FIND_CHILDREN;

Find a client window that is a child of the window given

XDO_FIND_PARENTS
enum XDO_FIND_PARENTS;

Find a client window that is a parent of the window given

XDO_SUCCESS
enum XDO_SUCCESS;
Undocumented in source.

Structs

charcodemap
struct charcodemap

@internal Map character to whatever information we need to be able to send this key (keycode, modifiers, group, etc)

xdo
struct xdo

The main context.

xdo_search
struct xdo_search

The window search query structure.

Meta