I would like to run scripts that will allow me to interact with the gui by sending windows events such as:

  • button presses
  • text insertion
  • window closing, minimizing
  • utilize an apps quick key combinations
  • etc.

Is there something out there for Ubuntu that does this?

  • same question in my head, upvoted. – H_7 Mar 6 '12 at 18:36
  • 1
    I hope we get this answer. Fingers x – bambuntu Mar 6 '12 at 18:43
  • I was trying bashscript.. – H_7 Mar 6 '12 at 18:47
  • I guess some1 will point you to phyton, before your question goes closed. – H_7 Mar 6 '12 at 18:48
  • Remember to choose right answer. – H_7 Mar 9 '12 at 23:39

In the world of old programmers, script and GUI are two words that live in totally different worlds. That looks like a myth very well established for many reasons.

Any way, the world of web applications is throwing this tine line away, and more and more people are looking for this, and some of them point this as a new tendence.

Why not simple scripts, with simple gui's? First one to start this kind of project, BUMM...

Well, I did my shots at Bashscript, as I am a big beginner in programming. You can take a look at

  1. xdotool

  2. glade

  3. gtk

    and the obvius phyton advanced scripting language, which I know nothing about it. (google about this itens, they will be very helpfull whatever language you choose it)

The dialog command in bash is very nice to do some simple Gui's, I guess this is the best beggining I can point you. xdotool is a interactive mouse/keyboard tool, glade is a full program to make Gui for many languages, and gtk is a lybrary/toolkit u can use with C++ or Pỳthon I guess... Good research wait for you.

  • I guess is gTK+-2.0 – H_7 Mar 6 '12 at 18:57
  • 1
    +1 for xdotool that actually does the UI-automation. – aquaherd Mar 8 '12 at 19:37

zenity might be useful for this task. look at the manual pages. below is a simpe bash script example. hope it helps someone.

# filename: cylvolcal.sh
# simple example of using zenity to interact with a graphical user from a bash script
# ubuntu version 14.04
# calculate the volume of a cylinder with diameter and length entered by the user
# and have the answer displayed to the user in a graphical info box.
# bash doesn't handle decimals well so pi is set to 3
dia1=`zenity --entry --title="enter diameter" --text="in metres"`
len1=`zenity --entry --title="enter length" --text="in metres"`
zenity --info --title="cylinder volume" --text="the volume of your cylinder is `echo $vol1`"
exit 0

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.