I'm new to xdotool and I have a bash script to do some automated clicks for me, but the clicks don't seem to be occurring. I think it's because I'm not selecting the window, though I'm not very confident about that assessment.
Here's what I have so far:
#!/bin/bash
for x in $(seq 1760 45 1895)
do for y in $(seq 760 45 985) do xdotool mousemove x y click 3 sleep 0.1 xdotool mousemove x y+20 click 1 sleep 0.1 done
done 0 1 Answer
Most importantly, a variable is called using $, and y+20 doesn't work that way. However, you don't even need to calculate that, just use mousemove_relative 0 20:
#!/bin/bash
for x in {1760..1895..45}; do for y in {760..985..45}; do xdotool mousemove --sync $x $y click 3 sleep 0.1 \ mousemove_relative --sync 0 20 click 1 sleep 0.1 done
doneAdditional changes I made:
- substitute the
seqsubshell using Brace Expansion - use
xdotool's builtinsleepfunction → only call it once - call
mousemovewith the--syncoption to let it wait until the mouse is actually moved