[SOLVED] Programmatically moving the mouse with the "xdotool"
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Programmatically moving the mouse with the "xdotool"
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
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?
What is this script supposed to do? Did you write it? To what purpose?
shruggy,
you are correct. It is not the version that matters in this case.
To install the new version I used "Synaptic" utility, which under Debian 10 requires the disabling of "Wayland" to install a package. I didn't re-enabled "Wayland" before testing and that led me to the incorrect conclusion.
Without "Wayland" the functions of "xdotool" work properly.
ondoho,
thank you for the links you suggested. You are right I have a lot to learn about the vast complexity of a Linux system. That's in part why I am on this site.
What I really would like do to is to programmatically move the mouse in a Debian 10 Live system, similarily to what I was able to do with Tails 4.15 and Debian 9.9 Live.
If "xdotool" is not possible to use in a Debian 10 Live system because of the default configurations, what other tool could you suggest to move the mouse?
I have a lot to learn about the vast complexity of a Linux system.
"Vast" is an exaggeration, and you don't need to know all of it anyhow, just get a basic overview of its structure - and more importantly: learn how to research things you don't know.
Quote:
Originally Posted by PaulExordium
If "xdotool" is not possible to use in a Debian 10 Live system
First of all you should ascertain whether that system runs under wayland or Xorg, I'm not so sure about your conclusion: https://unix.stackexchange.com/quest...-is-being-used
Which Debian Live image are you using? Link please.
ondoho,
I had already ascertained that the live OS system (debian-live-10.7.0-amd64-gnome.iso) run under wayland, the default setting. So I reiterate my question: is there another tool that could be used to move the mouse?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.