I have a GUI application which starts with a shell script. How can I create an icon in the Unity dock by providing the shell script and an .svg icon?
- 5,937
1 Answers
You need to make a shortcut-file. Shortcuts for the Unity dock are located in ~/.local/share/applications/
Create a file myGUIapp.desktop in that directory.
Paste the following into that file (with correct paths for icon and shellscript):
[Desktop Entry]
Name=My GUI App
Exec=/path/to/shellscript.sh
Icon=/path/to/you/icon.svg
Terminal=false
Type=Application
StartupNotify=trueMake the file executable:
Right click -> Properties -> Permissions -> Tick ‘Allow executing as a program’
Restart Unity (or drag the file to the Dock to get it there directly).
Look in other files in ~/.local/share/applications/ to get an idea of how they should look. More info is available in this blog entry.
Edit:
If you want the shortcut to be accessable to all users you should check out Ubuntu packaging guide about icons.
Basically the .desktop-file are installed or moved to /usr/share/applications/<binary>.desktop instead and icons are placed in /usr/share/icons/hicolor/scalable/apps
- 3,485
- 19
- 29