Input
Getting Started
Which tool works depends on your display server: xclip, xsel, and xdotool are for X11, while wl-copy, wtype are for Wayland. ydotool works on both because it injects events at the kernel level (it needs the ydotoold daemon running and root or uinput access).$ echo $XDG_SESSION_TYPE
Clipboard on X11
Copy a file or command output to the clipboard, and paste it back out.$ xclip -sel clip [file]
$ xclip -o -sel clip
xsel does the same job with slightly different flags.$ xsel -b < [file]
$ xsel -b
X11 has two clipboards: the regular one (-sel clip, pasted with Ctrl+V) and the primary selection (pasted with the middle mouse button).Moving the Mouse
Move to an absolute screen position, or relative to the current position.$ xdotool mousemove [x] [y]
$ xdotool mousemove_relative [x] [y]
$ ydotool mousemove --absolute [x] [y]
$ ydotool mousemove [x] [y]
Clicking
xdotool numbers buttons 1 (left), 2 (middle), 3 (right). ydotool uses button codes: 0xC0 left, 0xC1 right, 0xC2 middle.$ xdotool click 1
$ xdotool click 3
$ ydotool click 0xC0
$ ydotool click 0xC1
Pressing Keys
xdotool and wtype accept key names. ydotool uses Linux keycodes with :1 for press and :0 for release, so Escape (keycode 1) is 1:1 1:0.$ xdotool key Escape
$ xdotool key ctrl+shift+t
$ wtype -k Escape
$ ydotool key 1:1 1:0
Find keycodes for ydotool in /usr/include/linux/input-event-codes.h, for example KEYENTER is 28 and KEYLEFTALT is 56.