Skip to content

Instantly share code, notes, and snippets.

@pawiromitchel
Created June 24, 2020 22:39
Show Gist options
  • Save pawiromitchel/5ce85d808ddeab618d03d3fdca5d5b49 to your computer and use it in GitHub Desktop.
Save pawiromitchel/5ce85d808ddeab618d03d3fdca5d5b49 to your computer and use it in GitHub Desktop.
Automove mouse in Linux
# infinite loop, press Ctrl + C to stop
while :
do
# get a random number between -200 and 200 for X and Y
x=$((-200 + RANDOM % 200))
y=$((-200 + RANDOM % 200))
sleep=$((1 + RANDOM % 5))
echo "sleep for" $sleep "seconds"
sleep $sleep
echo "x" $x "y" $y
# move the mouse randomly
xdotool mousemove_relative --sync -- $x $y
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment