I want to add a custom program to the favourites of Ubuntu dock, but there is no option for that.

enter image description here

Translating the text in this image (same as above) only says:

  1. All windows

  2. Quit

It also doesn't appear in "Show Applications":
enter image description here

Is there a way for adding the program to both Favourites and Applications menus?

  • 1
    I want to do the same thing, but it appears this is some war crime.
    – Steve3p0
    Commented May 7, 2022 at 0:58

1 Answer 1


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

[Desktop Entry]
Comment=My fancy new application

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!

  • 8
    This doesnt work anymore on 18.04 :( Commented Oct 14, 2018 at 10:19
  • 5
    Shervin: I can verify that this still works on 18.04, both using /usr/share/applications or ~/.local/share/applications. You may need to restart gnome to update the cache.
    – Martin W
    Commented Oct 16, 2018 at 21:54
  • 20
    One step is missing from the description to make it work: the .desktop file needs to be executable, so run e.g. chmod a+x eclipse.desktop, see askubuntu.com/questions/1082340/how-to-add-eclipse-to-favorites
    – dariok
    Commented Jul 17, 2019 at 10:11
  • 25
    For anyone looking to do this from the command line, run dconf read /org/gnome/shell/favorite-apps, and you will get a list which starts like ['firefox.desktop', 'org.gnome.Nautilus.desktop']. Add your new .desktop file to the list and run the appropriately-modified command dconf write /org/gnome/shell/favorite-apps "['firefox.desktop', 'org.gnome.Nautilus.desktop', 'my-app.desktop']". (Be careful since you'll lose your existing favorites if you forget to include them with the dconf write command.)
    – Ben Mares
    Commented Feb 17, 2020 at 14:31
  • 2
    This answer misses that you have to set the executable bit + mark it as trusted: askubuntu.com/a/1152748/37881
    – Robert
    Commented May 25, 2020 at 11:59

Not the answer you're looking for? Browse other questions tagged .