LinuxQuestions.org
Visit Jeremy's Blog.
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 08-08-2008, 05:52 AM   #1
swift2008
Member
 
Registered: Jul 2008
Posts: 78

Rep: Reputation: 15
gui for web browser in linux


hi all

i would like to create gui in the web browser.
but i dont know to to develop gui on the browser in "linux".

will you please tell me how to do this, and any tutorials for this.
 
Old 08-08-2008, 06:03 AM   #2
alex1983-0112
Member
 
Registered: Apr 2008
Location: Russia
Distribution: Fedora Core
Posts: 30

Rep: Reputation: 16
You must to investigate QT/KDE or GTK for it.
 
Old 08-08-2008, 06:12 AM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Do you mean using a webpage as a GUI? There are lots of possibilities there, such as php, cgi scripts and ajax. I've done some work recently using cgi scripts written in BASH, which provide some basic functions to a user through a web interface.
 
Old 08-08-2008, 06:16 AM   #4
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
As much as I hate to say this, Java.
 
Old 08-08-2008, 06:27 AM   #5
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 510

Rep: Reputation: 53
GUI in a webbrowser usally means XHTML plus CSS, I'd say.

In Firefox/Mozilla on the other hand, there's always the option of using XUL with CSS which is very powerful and relatively easy to use.
 
Old 08-11-2008, 05:35 AM   #6
swift2008
Member
 
Registered: Jul 2008
Posts: 78

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gnashley View Post
Do you mean using a webpage as a GUI? There are lots of possibilities there, such as php, cgi scripts and ajax. I've done some work recently using cgi scripts written in BASH, which provide some basic functions to a user through a web interface.
hi
can you give me an example program for bash script.
please refer me good tutorials
 
Old 08-11-2008, 09:00 AM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
While bash can be used to write CGI scripts, it is not the traditional way. Perl & PHP are much more common, among others. A quick Google search for 'Perl CGI' yielded a gzillion tutorials and HowTos. I believe the code upon which this forum is based is an open source package, possibly called PHPBBS, and contains many lines of PHP code. I guess I would consider it a form of GUI.
Can you give us an example of something specific which you are trying to accomplish?
--- rod.
 
Old 08-11-2008, 10:32 AM   #8
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Here'S a really simple example:

Code:
#!/bin/bash 

# let's set how the script will be viewed 
echo "Content-type: text/html" 
echo "" 

# now for the guts :) 
echo "<html>" 
echo "Today is " $(date) 

# if we want to enter text from a command without it being changed 
echo "The users logged onto the server are: " 
# we would use the pre tag 
echo "<pre>" 
who 
echo "</pre>" 
echo "</html>"
Here's a little more complex example:
Code:
#!/bin/bash --
echo -en "Content-type: text/html\n\n<META HTTP-EQUIV="REFRESH" CONTENT="5\;URL=/httpd/html/bash-cgi/env.cgi">\n"
echo "<html><head><title>OS Version</title></head><body><H1>"; /usr/bin/env
echo "</H1></body></html>"
What I'm doing is using a simple web page which includes some code like above and with links to other cgi scripts written in bash which output other stuff.

I found only one or two resources which deal specifically with bash cgi.
One is called 'Webash': http://webash.virtuale.googlepages.com/
A bash functions library that aims to give to the bash programmer the ability to create simple web form pages in real-time with session management and MySQL wrappers, to build a "Xdialog-like" application, also complex.

And 'bashlib': http://bashlib.sourceforge.net/
bashlib is a shell script that makes CGI programming in the bash shell easier, or at least more tolerable. It contains a few functions that get called automatically and place form elements (from POSTs and GETs) and cookies in your environment. It also contains complete documentation on how to use these variables and how to set cookies manually.

I'm kinda nuts about doing things with bash-only. If you are too, you might want to look at some stuff I put together and call BashTrix -over a dozen bash-only scripts which rpovide basic replacements for system command like cut, cat, dirname and others. The most recent exciting one is not uploaded yet(an implementation of wget)
You can see the others here:
http://distro.ibiblio.org/pub/linux/...ects/BashTrix/
 
Old 08-11-2008, 11:19 PM   #9
swift2008
Member
 
Registered: Jul 2008
Posts: 78

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gnashley View Post
Here'S a really simple example:

Code:
#!/bin/bash 

# let's set how the script will be viewed 
echo "Content-type: text/html" 
echo "" 

# now for the guts :) 
echo "<html>" 
echo "Today is " $(date) 

# if we want to enter text from a command without it being changed 
echo "The users logged onto the server are: " 
# we would use the pre tag 
echo "<pre>" 
who 
echo "</pre>" 
echo "</html>"
Here's a little more complex example:
Code:
#!/bin/bash --
echo -en "Content-type: text/html\n\n<META HTTP-EQUIV="REFRESH" CONTENT="5\;URL=/httpd/html/bash-cgi/env.cgi">\n"
echo "<html><head><title>OS Version</title></head><body><H1>"; /usr/bin/env
echo "</H1></body></html>"
What I'm doing is using a simple web page which includes some code like above and with links to other cgi scripts written in bash which output other stuff.

I found only one or two resources which deal specifically with bash cgi.
One is called 'Webash': http://webash.virtuale.googlepages.com/
A bash functions library that aims to give to the bash programmer the ability to create simple web form pages in real-time with session management and MySQL wrappers, to build a "Xdialog-like" application, also complex.

And 'bashlib': http://bashlib.sourceforge.net/
bashlib is a shell script that makes CGI programming in the bash shell easier, or at least more tolerable. It contains a few functions that get called automatically and place form elements (from POSTs and GETs) and cookies in your environment. It also contains complete documentation on how to use these variables and how to set cookies manually.

I'm kinda nuts about doing things with bash-only. If you are too, you might want to look at some stuff I put together and call BashTrix -over a dozen bash-only scripts which rpovide basic replacements for system command like cut, cat, dirname and others. The most recent exciting one is not uploaded yet(an implementation of wget)
You can see the others here:
http://distro.ibiblio.org/pub/linux/...ects/BashTrix/
thank you
i will try this example
 
Old 09-13-2008, 04:37 AM   #10
vaisarger
LQ Newbie
 
Registered: Apr 2004
Distribution: SuSE 8.2
Posts: 11

Rep: Reputation: 0
Hi all !!
I'm the webash creator.
If you want ask me any question about using BASH for WEB, send me an e-mail
vaisargerYOUKNOWWHATMUSTDOWITHTHISatyahooDOTit.

Actually I often use webash for web html form creation, in many little services like "ChangeUserPassword.cgi", database viewers and managers, and so on. One day "php man" in my team didn't managed to write a HTML/PHP page that made the job done -I'm talking about changing UNIX password to system users via WEB- ( system() PHP function limitations in SE Linux environment, maybe??? ), on the contrary I through webash did... ;-)
So since that day we began using bash for web interactive services also.

This post only to say that my site changed address:
http://webash.virtuale.googlepages.com



Please, tell me your comments/suggestions !!

Vic
 
Old 09-13-2008, 04:46 AM   #11
vaisarger
LQ Newbie
 
Registered: Apr 2004
Distribution: SuSE 8.2
Posts: 11

Rep: Reputation: 0
Oooops !
You had RIGHT web address... ( I'm sorry ) I was wrong!
You know, unfortunately most sites talking of CGI/web bash scripts/webash library have the old wrong address ! Well...

Bye !
Vic
 
Old 09-13-2008, 10:51 AM   #12
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Hello Vittorio, glad you chipped in to this thread. I haven't gotten around to experimening much with your library, but hope to soon.
I have an idea about creating a sort of quiosk frontend for a system, using a browser as the main (or only) interface. I'm not proficient in perl/C/C++ so a bash-based solution works well for me. I am running thttpd and allowing local access to several services which use an html page as the interface -things like namzu (a desktop text search engine), ainebot ( a small chatbot written in C that uses a cgi inteface as well as console and GUI), didwiki (which provides its' own server -all available from a main html page which has menu entries for various small utilities like I gave in the examles above. I'm trying to keep the code as simple as possible so it can be used with diloo or text-based browsers. I've come up with a few 'widgets' which can be used to dynamically create web-pages with a pretty easy syntax and uniform appearance.

I'm glad to hear from you and hope you are still working on your nice little library.
 
Old 09-13-2008, 12:53 PM   #13
vaisarger
LQ Newbie
 
Registered: Apr 2004
Distribution: SuSE 8.2
Posts: 11

Rep: Reputation: 0
gnashley thank you very much for your words.

What you need there is already in my library, and more: for example, you can take your first page variables and bring'hem around for all pages you want ( session management ) -it' like BASIC, _very_ easy-, or you can manage a Mysql database simply with a function: table__cgi(), or redirect your script to an external web page, etc. .

The main Webash limit is its concept: Webash is for web what Xdialog is for local machine: a commands front-end ( let's say a graphical "echo", "read", or "select" and so on ). Obviously, a simple ">Xdialog --textbox 'Please, write your name'" is not like the amarok gui, I mean Xdialog ( and my library ) are groups of atomic elements, you can not build a complex gui with menus, various colors, images, etc., and programs you can create using'hem are basically: "step by step", or if you want "OK button click by OK button click".

This to say that if you want a nice first page, you should use stuff like
echo "Content-type: text/html"
echo ""

echo "<html>"
echo "BLA-BLA-BLA-BLA"
echo "</html>"

with nice colors, images and so on.
But if you want a session management, a serious management of your program variables, logical flow, and so forth, or a easy front end to a database, there isn't in the Web a "bash mechanism" easier than Webash.
Sure ! Because I did need to write it myself !!!
 
  


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
Best Web Browser for Linux 10xOXR Linux - Software 14 04-16-2005 01:16 AM
I need a non GUI web browser for my router. Posty Slackware 7 10-23-2003 04:10 PM
what you think best web browser of linux ? eye Linux - Software 5 05-18-2003 05:32 AM
what's the best web browser for linux? drclaw Linux - General 2 12-13-2000 08:57 AM

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

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