I need to get the current mouse coordinates in bash and xdotool doesn’t seem to be working for me. How would I do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To avoid all the sed/awk/cut stuff, you can use
In particular,
will put the position into shell variables
X,YandSCREEN. After that,will give a snippet ready for a later
xdotool mousemoveor any other use.My extra for sequential clicking into a few positions is a file positions.txt (given by a few eval/echo runs):
And the code that uses it is:
If there is no need to scale pixels (unlike my case), it could be a simple