LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-06-2007, 05:16 AM   #1
Joydeep Bakshi
Member
 
Registered: May 2007
Distribution: debian
Posts: 62

Rep: Reputation: 15
Question How to make GUI for shell script ?


Dear all,

I love to make shell scripts and I have written some useful scripts for personal usage. I like to add simple GUI to my scripts. I know that there is gtkdialog. Is not there anything else to make nice GUI for shell scripts ? I have heard about TCl/TK but have no idea about making GUI with this tool. Even I have not found any tutorial to do the same with TCL/TK. Could any one kindly suggest me about the availability of a tool to make GUI for shell scripts or how to use TCL/TK for the same ?

I know visual bash is there BUT I am not interested to use it as it is based on KDE where my system is non KDE.

Please enlighten me. Thanks
 
Old 11-06-2007, 05:39 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
If all you want to do is make dialog boxes, consider zenity. This is quite a flexible tool, although limited to dialog-type tasks.

If you want to implement a more completed GUI, it's going to get more complicated. Tk is a fairly easy-to-use GUI toolkit, and has bindings to several languages. Probably the easiest to work with (if you don't already know one of the alternatives) it TCL. TCL is a nice little language - there is not a lot of syntax to learn, and it turns out to be quite expressive. Using Tk from a TCL program is what is referred to with the name TCL/Tk.

If you install Tk, you will get a program called wish, which is a TCL interpretter with the Tk features available. The Tk package in Ubuntu comes with a whole bundle of examples, which you can read and learn from. Of you use another distro, YMMV.

For example, I find the file /usr/share/doc/tk8.4/examples/widget, and can launch it like this:
Code:
wish /usr/share/doc/tk8.4/examples/widget
This is a demo program which will launch all the other demo programs, and show you the code.

Note that the syntax of TCL is not the same as shellscript - it is a different language. Also note that Tk doesn't tend to look as nice as a lot of other GUI toolkits.
 
Old 11-06-2007, 11:47 PM   #3
Joydeep Bakshi
Member
 
Registered: May 2007
Distribution: debian
Posts: 62

Original Poster
Rep: Reputation: 15
Thanks for your response. Just making dialog boxes is not my motto. I need a tool which can GUI-fy the shell script. I have no idea about TCL/TK. Is it possible to make a GUI interface of shell script using TCL/TK ?
thanks
 
Old 11-07-2007, 01:43 AM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Not really, you have to write your program in TCL. There are also bindings for Tk to Perl and Python.
 
  


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
Unable to make generalize shell script pawan_songara Programming 2 08-29-2006 03:00 PM
how to execute a shell script in GUI by double click kamesh156 Programming 1 10-18-2005 05:25 AM
GUI for a Shell Script lazkyr Programming 4 08-18-2004 07:16 AM
How to make a GUI for a Script oldstinkyfish Programming 5 07-25-2004 03:18 AM
How to make a simple addition in a shell script. philipina Programming 2 03-16-2004 04:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:45 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