LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 08-17-2004, 05:26 PM   #1
lazkyr
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?

Lazaros
 
Old 08-18-2004, 12:24 AM   #2
cppkid
Member
 
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 kde.org 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
idaho
Member
 
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
cppkid
Member
 
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
tonyfreeman
Member
 
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 187

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 www.freshmeat.net and do a search on Xdialog.

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

-- Tony
 
  


Reply


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


All times are GMT -5. The time now is 10:09 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration