ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)
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.
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?
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.
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.