Adding custom programs to favourites of Ubuntu Dock [duplicate]

Solution 1:

This is fairly easy. First, make a desktop application file that follows the freedesktop.org spec, e.g.

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=MyApplication
Comment=My fancy new application
Exec=my_application
Icon=my_application.png
Terminal=false

If you want this to be usable by anyone on your system, put it in /usr/share/applications. For personal use only, you can put it in ~/.local/share/applications. Look in /usr/share/applications for other examples. Add your icon image to the /usr/share/icons directory, or I assume the ~/.local/share/icons, although I have not tried that last location myself.

Then, you can search for the application by name and drag it to the launcher in the usual way!