Skip to content

Instantly share code, notes, and snippets.

@michaelskyba
Last active May 21, 2021 13:14
Show Gist options
  • Save michaelskyba/b480633a07f4e9ed440085bb762b8e9e to your computer and use it in GitHub Desktop.
Save michaelskyba/b480633a07f4e9ed440085bb762b8e9e to your computer and use it in GitHub Desktop.
#!/bin/sh
# Script to easily find xy values for moving the mouse
# This is a helper script for the "automate" script
# Usage: xy <list of titles>
# E.g. you are on youtube and want to move the mouse to a video thumbnail
# (maybe clicking it), then to the youtube logo
# You would do:
# xy "video thumbnail" "youtube logo"
# These titles are a thing so that it's much easier to keep track of which positions are which
# if you only need one coordinate, you can do "xy e" or something
# Move your mouse to the corresponding position (the video thumbnail in the
# previous example), and then press Enter in the terminal
# (obviously don't move your mouse to get to the terminal, or you will change the position)
for title in "$@"
do
read
eval $(xdotool getmouselocation --shell)
echo "-- $title --"
echo "move $X $Y"
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment