Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 08-17-2004, 05:26 PM   #1
LQ Newbie
Registered: Jul 2004
Location: GREECE
Posts: 2

Rep: Reputation: 0
Lightbulb GUI for a Shell Script

I have a file with passwd format.I made a script for this file that is working as I wanted it to work.I have a list of options and each time I give an option,the script is doing something(for example,if I press "b" it makes something and if I press "a" it makes something else).All the results are an output from the file.
My question is how can I create a GUI for this script.For example if I want the script to do what it would do if I pressed the "a" button on my keyboard,but not by pressing "a",but by choosing from a drop down list or some other graphical feature(by ticking a check box).Can I do this with java?

Old 08-18-2004, 12:24 AM   #2
Registered: Jul 2004
Location: Pakistan
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
Its not a difficult task there are many ways you can achieve this, I mean many tools and libraries but i recommend you the QT library that is simple and eassy. Just open QT designer make a new wedget and drag some buttons on it and then define an event slot for each button and then save it. The just open it in KDevelope and make the subclass and give the implementation of those slots. To run a script you can you the system command to and execute your script file or there are more ways to do this. Compile Run And Enjoy
Look the combination of QT and Kdevelop is very eassy and simple. I know if you are new to this you may find it confusing, If it is so simply go to and see the tutorial of QT, just folow some simple steps and learn to make GUI's.
Old 08-18-2004, 12:29 AM   #3
Registered: Aug 2003
Location: Portland, Oregon
Distribution: RedHat, Libranet
Posts: 438

Rep: Reputation: 30
Another option for wrapping a GUI around your script is to run it as a CGI script from a web form served by a webserver on your local box.
Old 08-18-2004, 12:32 AM   #4
Registered: Jul 2004
Location: Pakistan
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
But i don't think that CGI is good for that work, or it is made for that work. As i also mentioned that there are many options but you choose the simplest to start with and also i think there may be some restrictions while using CGI and running your scripts directly from your web browser. Coz its a serious security problem. If you want to go for an alternate approach then JAVA is a good solution i thing or GTK. But i think QT is simple and best.
Old 08-18-2004, 07:16 AM   #5
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 190

Rep: Reputation: 30
3 or more shell gui options

Hello lazkyr,

I've just had to put a GUI to one of my shell scripts for an old RedHat 7.2 machine. The program I used for this is Xdialog (because it has a password entry field). There are several others out there in this class such as "dialog, zenity, gdialog, etc". Go to and do a search on Xdialog.

These programs make it really easy to put a GUI on shell scripts.

-- Tony


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Shell script inside shell script treotan Linux - General 4 02-19-2009 06:34 AM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
how to execute a shell script in GUI by double click kamesh156 Programming 1 10-18-2005 05:25 AM
1. shell script "find and replace" on text 2. java GUI application randomx Programming 4 03-05-2004 01:01 PM > Forums > Non-*NIX Forums > Programming

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

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