Skip to content

Instantly share code, notes, and snippets.

@snoble
Created August 19, 2021 00:12
Show Gist options
  • Save snoble/2c0a3bf95183f8f8043d98af2d43a2f7 to your computer and use it in GitHub Desktop.
Save snoble/2c0a3bf95183f8f8043d98af2d43a2f7 to your computer and use it in GitHub Desktop.
#!/bin/bash
eval $(xdotool getactivewindow getwindowgeometry |
sed -n -e "s/^ \+Position: \+\([0-9]\+\),\([0-9]\+\).*/x=\1;y=\2/p" \
-e "s/^ \+Geometry: \+\([0-9]\+\)x\([0-9]\+\).*/w=\1;h=\2/p" )
let ox=$w/3
let mx=$x+$ox
let oy=$h/3
let my=$y+$oy
xdotool mousemove $mx $my
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment