ydotool
Simulate keyboard and mouse events
TLDR
Start the ydotool daemon in the background
Perform a
Perform a
Input
SYNOPSIS
ydotool [options] command [arguments]
PARAMETERS
--help
Show help message and exit.
--version
Show version and exit.
type
Type the given string.
key
Press and release the specified keys.
mousemove
Move the mouse cursor to the absolute (or relative if 'relative' is specified) coordinates (x, y).
mousedown
Press the specified mouse button.
mouseup
Release the specified mouse button.
click
Press and release the specified mouse button (equivalent to mousedown followed by mouseup).
selectwindow
Select a window to interact with. The window will receive all events
windowclose
Close window by provided ID
getwindowfocus
Get focus window ID
DESCRIPTION
ydotool is a command-line tool for Linux that allows you to automate keyboard and mouse actions within the X Window System. It provides a way to simulate user input, making it useful for scripting tasks, testing applications, and creating macros. Unlike some other automation tools, ydotool operates independently of specific window managers or toolkits, making it relatively versatile. It allows users to script keyboard input (typing text, pressing keys), mouse movements, and mouse clicks.
Important considerations:
Requires X11 to be running.
Needs sufficient privileges to interact with X11.
CAVEATS
ydotool relies on the X11 protocol and may not work in environments that do not support it, such as Wayland or purely command-line environments. The user needs correct permissions to access the X server.
BUTTON MAPPING
Mouse button numbers typically follow the convention: 1 - Left, 2 - Middle, 3 - Right, 4 - Scroll Up, 5 - Scroll Down.
KEY NAMES
Key names generally correspond to the key names found in `/usr/include/X11/keysymdef.h`, without the `XK_` prefix. For example, `XK_Enter` becomes `Enter`.
HISTORY
ydotool was created to address some limitations of existing X11 automation tools, aiming for a more flexible and reliable way to simulate user input. The development continues.