4

I need to use xdotool to quickly automate some click at specific locations of my screen. I could use the following script:

#! /bin/bash
sleep 0.5
xdotool click 200 150
sleep 0.5
xdotool click 200 175
sleep 0.5
xdotool click 1050 150
sleep 0.5
xdotool click 1350 450
sleep 0.5
xdotool click 1100 150

And it would work fine. However, xdotool is not installed on the machine I'm using, and I do not have root access. I cannot install it locally because the X11/extensions/XTest.h library is not present. What are my options?

Tim
  • 32,274
  • 27
  • 118
  • 177
  • 1
    Probably you could use some of the Gtk libraries for Python, I recall there's ways to move cursor, though not sure about clicking. – Sergiy Kolodyazhnyy Nov 16 '17 at 22:33
  • There's the `pyautogui` module, see https://automatetheboringstuff.com/chapter18/ – but of course that's far from being preinstalled. May I ask why you want to get control over the mouse on a system where you don't even have root access? – dessert Nov 17 '17 at 07:12
  • @dessert oh it’s a virtual machine provided by my university. I remotely connect to it, but one of the tasks I have to do is click the following buttons in order: Compile, Load, Reset, Clear, Run. Doing that every time I change the code is annoying! – Tim Nov 17 '17 at 11:24
  • And there is no CLI for whatever program you need to run there? Are you sure? How do you connect by the way? Maybe there's a way to control the mouse remotely? Btw, please always add additional information directly to your question ([edit]) using the [formatting tools](https://$SITEURL$/help/formatting) rather than using comments. – dessert Nov 17 '17 at 11:28
  • @dessert that information is not critical and makes the question overly specific. I know that there might be ways around this but I’m specifically asking for alternatives to xdotool. I have a workaround - controlling the mouse on the local machine but this isn’t perfect. – Tim Nov 17 '17 at 11:42

1 Answers1

0

You can compile xdotool statically and copy it to that machine.

Alternatively you can copy the dynamically linked binary and see if the libraries resolve.

V13
  • 101
  • 1