dotool - Simulate Keyboard and Mouse Input Anywhere (X11, Wayland, TTYs) - Linux CLI
gotbletu
https://sr.ht/~geb/dotool/ dotool reads actions from stdin and simulates keyboard/mouse input using Linux's uinput module. It works systemwide and supports keyboard layouts.
#dotool #xdotool #alternative
dotool cheatsheet
####; dotool execute keys echo key ctrl+space c | dotool
####; dotool execute special keys ##; ! = x:exclam , shift+k:2, shift+1 ##; dotool --list-x-keys echo key shift+1 x:exclam shift+k:2 | dotool
####; dotool print list of the possible linux keys dotool --list-keys
####; dotool print list of the possible xkb keys dotool --list-x-keys
####; dotool type words echo type hello world | dotool
####; dotool keydown { echo keydown A; sleep 3; echo key H shift+1; } | dotool
####; dotool mouseto grid jump ##; echo mouseto x y | dotool ##; 1920x1080 echo mouseto 0.2 0.8 | dotoolc # KP_1 - jump to grid (bottom-left) echo mouseto 0.5 0.8 | dotoolc # KP_2 - jump to grid (bottom-center) echo mouseto 0.8 0.8 | dotoolc # KP_3 - jump to grid (bottom-right) echo mouseto 0.2 0.5 | dotoolc # KP_4 - jump to grid (middle-left) echo mouseto 0.5 0.5 | dotoolc # KP_5 - jump to grid (middle-center) echo mouseto 0.8 0.5 | dotoolc # KP_6 - jump to grid (middle-right) echo mouseto 0.2 0.2 | dotoolc # KP_7 - jump to grid (top-left) echo mouseto 0.5 0.2 | dotoolc # KP_8 - jump to grid (top-center) echo mouseto 0.8 0.2 | dotoolc # KP_9 - jump to grid (top-right)
####; dotool mouse click echo click left | dotool echo click middle | dotool echo click right | dotool { sleep 1; echo click middle; } | dotool { sleep 1; echo click right; } | dotool
####; dotool mouse double click highlighting text single word ##; make sure theres spaces and semicolon { cmd; cmd2; } { sleep 1; echo click left; sleep 0.1; echo click left; } | dotool
####; dotool mouse triple click highlighting text full line { sleep 1; echo click left; sleep 0.1; echo click left; sleep 0.1; echo click left; } | dotool
####; dotool use different keyboard layout echo type azerty | DOTOOL_XKB_LAYOUT=fr dotool
####; dotool other keydelay, keyhold, typedelay, typehold ##; set the delay between/holding each key with the key* actions/type action. ##; the default keydelay and typedelay is 2ms, and the default keyhold and typehold is 8ms. keydelay MILLISECONDS keyhold MILLISECONDS typedelay MILLISECONDS typehold MILLISECONDS
####; dotoold start daemon then use dotoolc for client ##; use for long commands like, holding down keys infinity dotoold &
####; dotoolc drag-and-drop or highlighting-text mode ###; all dotoolc require daemon running ##; begin: echo buttondown left | dotoolc ##; end: echo buttonup left | dotoolc ##; copy/end: { echo key ctrl+c; echo buttonup left; } | dotoolc echo buttondown left | dotoolc echo buttonup left | dotoolc { echo key ctrl+c; echo buttonup left; } | dotoolc
####; dotool mousemove move the cursor relative to its current position, use whole numbers ##; echo mousemove x y | dotoolc echo mousemove 100 50 | dotoolc ... https://www.youtube.com/watch?v=cik2zaDaIdo
99147166 Bytes