Skip to content

Instantly share code, notes, and snippets.

@cmj
Created March 10, 2026 23:18
Show Gist options
  • Select an option

  • Save cmj/18c72a32b6f8063eccd4ea5216e27173 to your computer and use it in GitHub Desktop.

Select an option

Save cmj/18c72a32b6f8063eccd4ea5216e27173 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "move mouse over window"
sleep 4
cx=3500 # center X
cy=1600 # center Y
r=300 # radius
step=7 # degrees per step
circles=4 #
xdotool mousedown 1
for((i=1;i<=$circles;i++)); do
for ((a=0; a<360; a+=step)); do
x=$(awk -v cx=$cx -v r=$r -v a=$a 'BEGIN{printf "%d", cx + r*cos(a*3.14159/180)}')
y=$(awk -v cy=$cy -v r=$r -v a=$a 'BEGIN{printf "%d", cy + r*sin(a*3.14159/180)}')
xdotool mousemove $x $y
# random click ~10% chance
#if (( RANDOM % 10 == 0 )); then
# xdotool click 1
#fi
sleep 0.01
done
done
xdotool mouseup 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment