For 11.04 and earlier:
Unity does support custom launchers from .desktop files. To create custom launcher from a .desktop
file you need to create a *.desktop
file for your program.
gedit ~/.local/share/applications/name.desktop
The .desktop
file should look something like this:
[Desktop Entry]
Name=the name you want shown
Comment=
Exec=command to run
Icon=icon name
Terminal=false
Type=Application
StartupNotify=true
In your file manager open your home folder and navigate to:
(You may need to press ctrl+h to show hidden files to see the .gconf
directory.)
.gconf-> desktop-> unity-> launcher -> favourites
you'll see a bunch of folders starting with "app-
".
you need to create a folder for your program. Use the same name.desktop you used in /usr/share/applications
. Go into 1 of the folders for something that is already on the dock & copy the xml file and paste that into your new folder. Open it with your text editor and change the name of the *.desktop
to your name.desktop
.
Open gconf-editor (you can open gconf by running the command gconf-editor
in the Terminal) & go to:
desktop-> unity-> launcher -> favorites
Double click the list on the right & add your name.desktop
.
Log out & back in and you should see your launcher.
(thank you kerry_s on the Ubuntu Forums for helping with this answer)
Unity also has a feature called Lenses. By default, you have two in Unity: Applications and Files. In the future, you will be able to install and create a lot more. There is some info about that on the Ubuntu wiki: https://wiki.ubuntu.com/Unity/Lenses
I had the same kind of problems.
I can give you 2 directions:
- Use an application like 'Create Launcher' from mlux.at to create the launcher.
- If it is a shell script and you cannot launch it, then do an echo of the command that is executed and put this command into a script of your choice and use this one into the launcher.
Ex:
echo $_JAVA_EXEC $_VM_PROPERTIES -Xmx${MAXIMUM_HEAP_SIZE} -Dsmartsvn.vm-xmx=${MAXIMUM_HEAP_SIZE} -jar "$SMARTSVN_HOME/lib/smartsvn.jar" "$@"
was in smartsvn.sh
I created a file smart.sh and put inside
/home/rudy/opt/jdk1.6.0_33/bin/java -XX:-UseSSE42Intrinsics -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Xmx256m -Dsmartsvn.vm-xmx=256m -jar /home/rudy/opt/smartsvn-7_0_4/lib/smartsvn.jar
This time it was successful.
Hope it helps.
Best Answer
Easiest way imaginable:
Ordinarily start the application. When the icon appears in the Unity taskbar, right click the icon and chose
Lock to Launcher
.Note that this will create a
.desktop
file in~/.local/share/applications
.