YDOTOOL(1)

πŸ“¦
version 1.0.4 Β· 6 versions
, in ubuntu resolute, ubuntu stonking

✨ 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 position
  • click β€” 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. default 12ms.

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). default 12ms.
  • -D, --next-delay <ms> β€” delay between strings. default 0ms.
  • -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). default 25ms.
  • -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 - LEFT
  • 0x01 - RIGHT
  • 0x02 - MIDDLE
  • 0x03 - SIDE
  • 0x04 - EXTR
  • 0x05 - FORWARD
  • 0x06 - BACK
  • 0x07 - TASK
  • 0x40 - Mouse down
  • 0x80 - 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 down
  • 0x82: 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 🌈


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