I want to build a simple GUI for an app that use bash so for example clicking on a button would execute some bash commands and so one.

There's a GUI creator also simple, i need only buttons and textareas that doesn't require to learn a new programming launguage?


I posted an answer here, that may be useful, for convenience I will just put it here again.

Yad may be useful in this regard, it is a fork of zenity with more features, one of them the ability to create forms.

Here is a very simple example of a form:


frmdata=$(yad --title "Test Form" --form --field "Address" --field="Name")

frmaddr=$(echo $frmdata | awk 'BEGIN {FS="|" } { print $1 }')
frmname=$(echo $frmdata | awk 'BEGIN {FS="|" } { print $2 }')

echo $frmaddr > test.txt
echo $frmname >> test.txt

The above script will display a form like this:

enter image description here

After you enter your data and click ok or hit enter on the keyboard, the form data will be written to a text file called test.txt, I am using awk to separate the form data which is a string with a pipe as field separator, I believe there is a direct way to get the data without awk but I am no yad expert, please check the project home and ask questions, you may find a more elegant way.

How to get and install yad here:


yad project home:


more examples here:



There is no form designer for it yet but since the syntax is so simple and so close to zenity, that is not usually a problem.

  • wow it seems really cool but i can't find any type of docs... – Matteo Pagliazzi Dec 21 '11 at 16:08
  • i would like to do something like that dl.dropbox.com/u/1143206/myImage.png, is possible? – Matteo Pagliazzi Dec 21 '11 at 16:17
  • The developer site at the project home link has a lot of examples, and the developer himself is easy to talk to. – Sabacon Dec 21 '11 at 16:17
  • Based on the examples and what I have read about Zenity and Yad I believe you can do similar, – Sabacon Dec 21 '11 at 16:22
  • there are a lot of examples but hey aren't very useful at least for me, anyway now i'm emailing the developer... – Matteo Pagliazzi Dec 21 '11 at 16:33

For simple user-input you can use zenity (lives in the zenity package). A simple example might be something like this:

VARIABLE=$(zenity --entry --title="Give me inputz" --text="Write some stuff")

For a textarea (as we'd say in the HTML world), you'd change the syntax to something like this:

zenity --text-info --title="Give me inputz" --editable

You can find out a lot more from its manual. It's a very flexible little library user input in simple scripts.

Edit: You can also find some good examples over at Linuxaria.

  • when i'm usg editable, can i sho others thing like text, buttons, how? – Matteo Pagliazzi Dec 21 '11 at 15:22

Take a look at this: http://sites.google.com/site/easybashgui

You use:

source easybashgui
input 2 "Address" "?" "Name" "?"
cp "$dir_tmp/$file_tmp" "test.txt"

Try tkbash.

You can specify elements like this

tkbash 1 button b1 -x 0 -y 0 -w 100 -h 30 -t "click me" --command "notify-send hi"

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.