Simple automation with xdotool on Linux
Setup
Install xdotool on Linux
shsudo apt-get install xdotool
Examples
Move mouse
sh# xdotool mousemove x y xdotool mousemove 100 200
Move mouse and click
shxdotool mousemove 1815 177 click 1
Type and key press
shxdotool type 'cd ~' xdotool key Return xdotool key alt+Tab
Scroll
shcount=10 for i in $(seq $count); do # scroll up xdotool click 4 # scroll down xdotool click 4 done
Mouse drag
shxdotool mousemove 310 83 xdotool mousedown 1 xdotool mousemove_relative --sync 500 400 xdotool mouseup 1
Open a new terminal and connect to ssh
sh# open a terminal in a new window gnome-terminal -- sleep 0.5 xdotool type 'ssh user@1.2.3.4 -p 1234' xdotool key Return sleep 0.5 xdotool type 'password' xdotool key Return