How to Start Developing Gnome Apps

Peter Garrett peter.garrett at optusnet.com.au
Mon Apr 11 09:49:14 UTC 2005


On Mon, 2005-04-11 at 00:19 -0400, Ed Sutherland wrote:
> I want to start developing simply apps. At first, I want to develop a 
> simple bash script to do x,y,z and allow the user to start the script by 
> clicking on an icon. I guess my first question is: how to I provide a 
> script with a desktop icon? Thanks.
> 
> Ed
> 
> 
I would suggest, if you want some GUI things to click on, that you
install Xdialog

sudo apt-get install xdialog

Then open

/usr/share/doc/xdialog/html/index.html

with your preferred browser to read the (very thorough) documentation.

"Zenity" is similar and will look prettier (GTK 2 , whereas Xdialog is
GTK 1.2), but I found the docs inaccurate/ confusing. Zenity is
installed by default, however, so if you want to use that, go ahead.

To make a launcher icon for your script, just right click the desktop
and choose "Create Launcher". or right click the gnome panel and choose
Add to Panel >> custom launcher.

If you simply want to run your script in a terminal without a GUI, you
can launch it with a command like 

xterm -e /path/to/yourscript  

the -e option means "execute", and makes the script run in its own
xterm. You can do the same with gnome-terminal or aterm or your terminal
emulator of choice... Without the -e preceding your script, the xterm
will pop up and then disappear in an interesting but impractical manner
*grin*

If you'd like to see a little Xdialog script in action and read the
code, (such as it is - beginner here), I have an example at

http://users.fishinternet.com.au/~peterg/Timer_Script.html

Links to the script at the bottom of that page.

(shameless plug for my glorified kitchen timer/ pizza timer - please
excuse... ;-) )







More information about the ubuntu-users mailing list