2

I just came up with an idea for a useful computer program, but this would mean I would have to know how bash commands could be used to "click" on the gui buttons. Do you know anywhere I can find a list of explanations on how to do this or any examples to get me started?

  • Look into using xdotool: semicomplete.com/projects/xdotool – Nick Weinberg Nov 7 '16 at 21:51
  • Although xdotool can be used in some cases, it is only possible if you exactly know the location of a button on your screen, and then never the preferable option. I am not sure what kind of usage you have in mind, but it is always (much) better to use possible cli options of the targeted applications. – Jacob Vlijm Nov 8 '16 at 7:36
  • I wanted to create a program that can continuously cycle movies, for the purposes of entertaining people who physically can't do anything for themselves and relieves nurses from another set of mundane tasks...while the question is still interesting, there has to be an easier solution to my problem...since i like to pirate stuff, this would make this easy and cheap – thinksinbinary Nov 8 '16 at 14:19
  • Scripted, almost anything can be done. – Jacob Vlijm Nov 8 '16 at 20:16
4

The tool is xdotool (command-line X11 automation tool)

DESCRIPTION
   xdotool lets you programatically (or manually) simulate keyboard input
   and mouse activity, move and resize windows, etc. It does this using
   X11's XTEST extension and other Xlib functions.
2

If you were interested in calling some python from your bash script, I've had good luck with pyautogui in the past for automating keyboard actions. I found it very approachable.

https://github.com/asweigart/pyautogui

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.