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! |
I have used Zenity. I think other options include "dialog" or "kdialog"
|
|
Thanks, I'll have a look at it.
|
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. |
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? |
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 |
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. |
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. |
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). |
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. |