Create a launcher a link to a terminal program

Asked by Jose M. Caballero on 2010-12-08

I have some programs that I should execute with terminal because I don't know any other way to do it.
For example Geogebra.
I just execute in the terminal sh geogebra.sh wich has the text:

#!/bin/sh
jre/bin/java -jar geogebra.jar

Do you know how to create a desktop icon to link the program so I can execute it with double click?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-desktop Edit question
Assignee:
No assignee Edit question
Solved by:
Jose M. Caballero
Solved:
2010-12-08
Last query:
2010-12-08
Last reply:
2010-12-08

Right click on desktop and select Create Launcher...

New to Ubuntu:
- read the Ubuntu Manual, it's very informative: http://ubuntu-manual.org/
Click on the "download Button" to download the latest PDF version.
- The Ubuntu pocket guide: http://www.ubuntupocketguide.com/
- The online help https://help.ubuntu.com/10.04/index.html

Relax and fun:
http://planet.ubuntu.com/ and Full Circle Magazine http://fullcirclemagazine.org/

I know this question looks stupid, but I can't do it to work it.
What is the text in the link?

Please open a terminal

Change dir to your script location:

cd your_dir

Please made your script executable type:

chmod 700 your_script_name

Then create a terminal applications launcher

This is the first thing I have tried, but doesn't work (and I don't know why).

Seems you need to put into your script:

#!/bin/sh
cd $HOME/your_geogebra.jar_directory
java -jar geogebra.jar

or try the absolute path of java discover it with

which java

command

Works!
The final code of the desktop is:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=true
Icon[es_ES]=/home/user/geogebra/geogebra-logo.svg
Exec=/home/user/geogebra/jre/bin/java -jar /home/user/geogebra/geogebra.jar
Name[es_ES]=GeoGebra
Name=GeoGebra
Icon=/home/user/geogebra/geogebra-logo.svg

The problem now is to load the icon (it doesn't load it).

Right click on the properties and then on the icon and change it to the icon you want...

I have do it already.
And i have got the text you see up:

    ...
    Icon[es_ES]=/home/user/geogebra/geogebra-logo.svg
    ...
    Icon=/home/user/geogebra/geogebra-logo.svg

With an image .svg, that is the proper format for an icon.

But doesn't load it. Why?

Try to install the gimp package open the svg image and convert to png

Solved.
The icon can be an .png file too.

Here is the final code for the .desktop file:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=true
Icon[es_ES]=/home/user/geogebra/geogebra.png
Exec=/home/user/geogebra/jre/bin/java -jar /home/user/geogebra/geogebra.jar
Name[es_ES]=GeoGebra
Name=GeoGebra
Icon=/home/user/geogebra/geogebra.png