Create a launcher a link to a terminal program

Asked by Jose M. Caballero

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:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

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/

Revision history for this message
Jose M. Caballero (caballeroguerrero) said :
#2

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

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

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

Revision history for this message
Jose M. Caballero (caballeroguerrero) said :
#4

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

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#5

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

Revision history for this message
Jose M. Caballero (caballeroguerrero) said :
#6

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).

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#7

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

Revision history for this message
Jose M. Caballero (caballeroguerrero) said :
#8

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?

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#9

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

Revision history for this message
Jose M. Caballero (caballeroguerrero) said :
#10

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