xte
TLDR
Simulate key press
SYNOPSIS
xte [options] command [command...]
DESCRIPTION
xte generates fake keyboard and mouse input using the XTest X11 extension. It's part of the xautomation package and enables automation of GUI interactions from scripts.
Commands can be chained in a single invocation or across multiple calls. Key names follow X11 keysym naming conventions. Mouse buttons are numbered: 1 (left), 2 (middle), 3 (right), 4/5 (scroll).
Common uses include GUI testing, automating repetitive tasks, and creating macros. Often combined with xbindkeys for keyboard shortcuts.
PARAMETERS
-x display
Send commands to specified display.-i id
Use specific XInput device.
COMMANDS
key k: Press and release key k.
keydown k: Press key k down.
keyup k: Release key k.
str text: Type text string.
mouseclick n: Click mouse button (1=left, 2=middle, 3=right).
mousedown n: Press mouse button down.
mouseup n: Release mouse button.
mousemove x y: Move to absolute position.
mousermove x y: Move relative to current position.
sleep n: Sleep n seconds.
usleep n: Sleep n microseconds.
CAVEATS
X11 only; no Wayland support. The str command has limited Unicode support. Some applications may detect synthetic input. Part of xautomation package.
HISTORY
xte is part of xautomation, a suite of tools for X11 automation created by Steve Slaven. It provides a simple command-line interface to the XTest extension, which was designed for automated testing of X applications.


