dot_testing/builds/utils/sh/mousehelper
2023-12-05 21:43:38 -06:00

29 lines
487 B
Plaintext
Executable File

PADDING=50
eval $(
xdotool getwindowgeometry --shell $(
xdotool getactivewindow
) | \
xargs printf "export %s\n"
)
eval $(
xdotool getmouselocation --shell | \
xargs printf "export MOUSE%s\n"
)
case "$1" in
"top")
xdotool mousemove $MOUSEX $(($Y + $PADDING))
;;
"bottom")
xdotool mousemove $MOUSEX $(($Y + $HEIGHT - $PADDING))
;;
"left")
xdotool mousemove $(($X + $PADDING)) $MOUSEY
;;
"right")
xdotool mousemove $(($X + $WIDTH - $PADDING)) $MOUSEY
;;
esac