LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Makign a GUI for a Bash script (https://www.linuxquestions.org/questions/programming-9/makign-a-gui-for-a-bash-script-561451/)

aaargh486 06-13-2007 07:08 AM

Makign a GUI for a Bash script
 
I have made a Bash script for a pretty simple function (controlling my fans). But now I want to make a simple GUI for it. I would like to use it only to read some info about my PC (temperature, fan speed etc...) and change some settings my script uses.

But I have absolutely no experience with even simple GUI's in Linux. Do you have any recommendation of which language I should study to make SIMPLE GUI's, remember, only really basic functions.
(I thought about maybe I could use the Gtk implementation of Perl, but that could sound really stupid of course)

Many thanks in advance!

pixellany 06-13-2007 08:10 AM

I have used Zenity. I think other options include "dialog" or "kdialog"

wattana 06-13-2007 09:10 AM

Hi!

Take a look at Qt.

They have the fastest simplest way to make nice gui I've ever seen.

aaargh486 06-13-2007 09:25 AM

Thanks, I'll have a look at it.

theYinYeti 06-13-2007 10:16 AM

There are two ways you can create the GUI.

If you use Zenity or similar, you'll have to program the GUI inside your script.
The more Unix-like way would be to make your script responsive to some commands, eg: you send commands on the standard input, and receive results from the standard output; this way, you could create any number of GUI that would just be front-ends to the script. That's how mplayer GUI works as far as I know.

Yves.

aaargh486 06-13-2007 11:04 AM

I'm looking for a GUI that stands completely loose of the script. The script get its information from a configuration file, and I want to write a GUI that can edit that config-file, and restart the script if needed to.
What would you recommend in this case?

ta0kira 06-13-2007 11:51 AM

Check this out, too:
http://kommander.kdewebdev.org/

That seems like the simplest way to get the job done. Unless you are going to rewrite your code in C++, I wouldn't recommend Qt for this in particular.
ta0kira

gnashley 06-13-2007 12:36 PM

Xdialog is the old standard for this. It uses gtk libs so it will work on non-kde, non-gnome systems. If you only care about kde compatibility use kommander. If you only want gnome compatibility use zenity.
Xdialog should work on nearly any system and has the advantage(?) of using mostly the same syntax as dialog, in case you want to provide a console-based alternative.

schneidz 06-14-2007 01:58 PM

i'll add gdialog as an easy suggestion but you will need to call gdialog inside of your script (http://g-scripts.sourceforge.net/)

also v-tcl is a bit harder to master.

gnashley 06-15-2007 03:10 AM

Star your script and read the config file. Use that info to create your dialog boxes using any one of dialog(CLI ncurses), whiptail(newt libs), Xdialog(gtk), gdialog(gnome), zenity(gnome) or kommander(kde)

These programs will all return values based on the actions or values the user selects. Use them to rewrite or edit the config file and then exec the script again(The script runs itself again -the new process replaces the existing running process).

vaisarger 05-11-2010 09:20 AM

Hi. If you're looking for a GUI for shell script, take a look at my program:
https://sites.google.com/site/easyba...I_1.2.8.tar.gz

It has a library called "easybashgui" and a script used for showing its potential called "easydialog.sh".

Here there is all information
https://sites.google.com/site/easybashgui

BYE
Vic


All times are GMT -5. The time now is 03:55 AM.