Skip to content

Instantly share code, notes, and snippets.

@halvarsu
Created May 4, 2020 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halvarsu/eebf4559ebb0a91817cd2a063e497b9c to your computer and use it in GitHub Desktop.
Save halvarsu/eebf4559ebb0a91817cd2a063e497b9c to your computer and use it in GitHub Desktop.
Move mouse cursor to (the right of) center of screen and ctrl click.
#!/bin/bash
ACTIVEWINDOW=$(xdotool getactivewindow)
eval $(xdotool getwindowgeometry --shell $ACTIVEWINDOW)
HALF_WIDTH="$(($WIDTH / 2 + 10))"
HALF_HEIGHT="$(($HEIGHT / 2))"
xdotool mousemove --window $ACTIVEWINDOW $HALF_WIDTH $HALF_HEIGHT keydown ctrl click 1 keyup ctrl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment