I need to find a button's XY coordinates on screen using this button's image and then click at it. I can do this task on windows using AutoHotKey Image search. And I found out that ubuntu AutoHotKey alternative is AutoKey. But I couldn't find a way to do an image search on AutoKey. Does anybody know how to achieve this task?
1 Answer
You can obtain the current mouse coordinates with xdotool:
xdotool getmouselocationFor use in a script, use
eval $(xdotool getmouselocation --shell)This will create shell variables you can easily retrieve elsewhere in a script:
echo $X $Ywill print the coordinated.
Caveat this only works when you use Xorg (but then, also Autokey works only on Xorg).