Programmatically moving the mouse with the "xdotool"
by PaulExordium from LinuxQuestions.org on (#5D7FH)
After opening a "Mozilla Firefox" window, executing the following script will move the mouse correctly under Debian 9 but not under Debian 10. Any idea why?
Code:#!/bin/bash
winID=$(xdotool search --name "Mozilla Firefox")
echo $winID
xdotool getwindowname $winID
let x=1
let y=175
let i=1
let j=-1
for (( t=1; t<400; t++ ));
do
if [ $t -eq 100 ]; then let j=-$j; fi
if [ $t -eq 200 ]; then let i=-$i; fi
if [ $t -eq 300 ]; then let j=-$j; fi
let x=x+i
let y=y+j
xdotool mousemove --sync --window $winID $x $y
done
exit


Code:#!/bin/bash
winID=$(xdotool search --name "Mozilla Firefox")
echo $winID
xdotool getwindowname $winID
let x=1
let y=175
let i=1
let j=-1
for (( t=1; t<400; t++ ));
do
if [ $t -eq 100 ]; then let j=-$j; fi
if [ $t -eq 200 ]; then let i=-$i; fi
if [ $t -eq 300 ]; then let j=-$j; fi
let x=x+i
let y=y+j
xdotool mousemove --sync --window $winID $x $y
done
exit