3

I am working with a program that collects a lot of data then shows it to you in the program. Unfortunately, the program is poorly designed and requires you to "approve" each bit of data collected manually by clicking a checkbox to approve it. In order to automate this process, I wrote a small script that scans for a checkbox, clicks it, then clicks "next item".

Unfortunately, this requires moving the actual mouse, meaning I can't use my computer until the program has finished. There are other questions that reference automating this with the winapi, however none of these work on Linux. What is a way to automate this on Linux?

Jon
  • 2,566
  • 6
  • 32
  • 52

1 Answers1

3

You can simply start the program in a separate X server, for example using xvfb with

xvfb-run YOUR_PROGRAM

If you want to wrap just the instrumented program, that's possible too:

export DISPLAY=:42
Xvfb :42
THE_INSTRUMENTED_PROGRAMM
xdotool mousemove 1 1 click 1 # your instrumentation goes here
phihag
  • 278,196
  • 72
  • 453
  • 469
  • 1
    Yes, both programs need to run in the same X server. With option 1 (`xvfb-run`, you start a wrapper program that kicks off both the data collection program and your bot). With option 2, replace `THE_INSTRUMENTED_PROGRAM` with the program you're instrumenting (you call it `data collection program`) and `xdotool ...` with your bot. – phihag Jul 04 '17 at 01:03