Você encontrará a resposta na página do manual do xdotool :
getmouselocation [--shell] Outputs the x, y, screen, and window id of the mouse cursor. Screen numbers will be nonzero if you have multiple monitors and are not using Xinerama. --shell This makes getmouselocation output shell data you can eval. Example: % xdotool getmouselocation --shell X=880 Y=443 SCREEN=0 WINDOW=16777250 % eval $(xdotool getmouselocation --shell) % echo $X,$Y 714,324