YDOTOOL(1)
β¨ YDOTOOL(1) β the command-line /dev/uinput automation tool β¨
okay bestie, welcome to ydotool, section 1 of the General Commands Manual. she's a command-line /dev/uinput automation tool and she is so good at pretending to be your keyboard. π
πΈ SYNOPSIS πΈ
ydotool cmd args
ydotool cmd --help
π DESCRIPTION π
okay so real talk: ydotool lets you simulate keyboard input and mouse activity and stuff, either programmatically (like, from a script) or manually (like, you typing the command yourself). the way that it works is lowkey iconic.
β οΈ bestie the ydotoold(8) daemon must be running. no daemon, no vibes. that's the rule. π
here's what's currently implemented, command-wise:
typeβ types a string for you, like a lil ghostwriter π»keyβ presses keys (plural, she can do multiple)mousemoveβ moves the mouse pointer to an absolute positionclickβ clicks on mouse buttons. that's it. that's the whole thing.
β¨οΈ KEYBOARD COMMANDS β¨οΈ
key
key [-d,--key-delay <ms>] [<KEYCODE:PRESSED> ...]
type a given keycode, bestie. simple as.
e.g. 28:1 28:0 means pressing the Enter button on a standard US keyboard. (where :1 means the key is down and :0 means the key is released. press then release, iykyk.)
and check this out:
42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
that's literally "LOL". feel free to scream.
non-interpretable values β think 0, aaa, l0l β will only cause a delay. they don't do anything else, they just sit there and pass the time π«
you can find available key codes (KEY_*) by peeking at /usr/include/linux/input-event-codes.h. go look, it's fine.
and if you wanna find the key name/number your keyboard is sending to libinput, run sudo libinput record and then select your keyboard from the list β it'll show you the proper libinput key name and number for each key you press. very demure, very mindful, very useful π
Options:
-d,--key-delay <ms>β delay time between keystrokes. default12ms.
type
type [-D,--next-delay <ms>] [-d,--key-delay <ms>] [-f,--file <filepath>] "text"
types text as if you had typed it on the keyboard. it's giving keyboard cosplay, no cap.
Options:
-d,--key-delay <ms>β delay time between key events (up/down each). default12ms.-D,--next-delay <ms>β delay between strings. default0ms.-f,--file <filepath>β specify a file, and the contents of it get typed as if you'd passed them as an argument. the filepath can also be-to read from stdin. cute right? π
Example: to type 'Hello world!' you would do:
ydotool type 'Hello world!'
π±οΈ MOUSE COMMANDS π±οΈ
mousemove
mousemove [-a,--absolute] <x> <y>
moves the mouse to the relative X and Y coordinates on the screen. she's going places β¨
Options:
--absoluteβ use absolute position
Example: to move the cursor to absolute coordinates (100,100):
ydotool mousemove --absolute 100 100
click
click [-d,--next-delay <ms>] [-r,--repeat N ] [button ...]
sends a click. periodt.
Options:
-d,--next-delay <ms>β delay between input events (up/down β a complete click means doubled time). default25ms.-r,--repeat Nβ repeat the entire sequence N times π
all mouse buttons are represented using hexadecimal numeric values, with an optional bit mask to specify if mouse up/down needs to be omitted. here's the whole roster:
0x00- LEFT0x01- RIGHT0x02- MIDDLE0x03- SIDE0x04- EXTR0x05- FORWARD0x06- BACK0x07- TASK0x40- Mouse down0x80- Mouse up
Examples:
0x00: chooses left button, but does nothing (you can use this to implement extra sleeps π΄)0xC0: left button click (down then up)0x41: right button down0x82: middle button up
the 0x prefix can be omitted if you want. you do you, icon. π
π YDOTOOL SOCKET π
the socket that ydotool writes to for ydotoold(8) can be changed with the environment variable YDOTOOL_SOCKET. change it whenever. live your truth.
π AUTHOR π
ydotool was written by ReimuNotMoe. king behavior fr fr.
this manpage was written by bob.hepple@gmail.com but updated since. shoutout to both of them honestly π«Ά
π LICENCE π
AGPLv3
π SEE ALSO π
ydotoold(8)- Project site:
https://github.com/ReimuNotMoe/ydotool
and that's the whole page bestie!! this version is dated 2026-01-18 and it's from the General Commands Manual, YDOTOOL(1). now go automate something and slay π
β¨π¦
π¦ where this page comes from
- ubuntu resolute: ydotool 1.0.4-3 Β· AGPL-3.0-or-later
- ubuntu stonking: ydotool 1.0.4-3 Β· AGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms