LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-13-2007, 07:08 AM   #1
aaargh486
LQ Newbie
 
Registered: Jun 2007
Location: Huizingen, Belgium
Distribution: Ubuntu 7.04
Posts: 20

Rep: Reputation: 0
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!
 
Old 06-13-2007, 08:10 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I have used Zenity. I think other options include "dialog" or "kdialog"
 
Old 06-13-2007, 09:10 AM   #3
wattana
LQ Newbie
 
Registered: Mar 2007
Distribution: Fedora
Posts: 8

Rep: Reputation: 0
Hi!

Take a look at Qt.

They have the fastest simplest way to make nice gui I've ever seen.
 
Old 06-13-2007, 09:25 AM   #4
aaargh486
LQ Newbie
 
Registered: Jun 2007
Location: Huizingen, Belgium
Distribution: Ubuntu 7.04
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks, I'll have a look at it.
 
Old 06-13-2007, 10:16 AM   #5
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
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.
 
Old 06-13-2007, 11:04 AM   #6
aaargh486
LQ Newbie
 
Registered: Jun 2007
Location: Huizingen, Belgium
Distribution: Ubuntu 7.04
Posts: 20

Original Poster
Rep: Reputation: 0
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?
 
Old 06-13-2007, 11:51 AM   #7
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
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
 
Old 06-13-2007, 12:36 PM   #8
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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.
 
Old 06-14-2007, 01:58 PM   #9
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
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.
 
Old 06-15-2007, 03:10 AM   #10
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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).
 
Old 05-11-2010, 09:20 AM   #11
vaisarger
LQ Newbie
 
Registered: Apr 2004
Distribution: SuSE 8.2
Posts: 11

Rep: Reputation: 0
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

Last edited by vaisarger; 06-30-2010 at 09:00 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
passing variable from bash to perl in a bash script quadmore Programming 6 02-21-2011 04:11 AM
[bash] having trouble debugging this bash script. jons Programming 4 02-08-2007 06:51 AM
Bash script - how to tell if in GUI or CLI? dive Programming 2 11-19-2005 02:12 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
bash script prob: how can i tell the script that a 'dd' has finished? Frustin Linux - General 2 04-02-2003 05:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration