I have a custom .desktop file:

[Desktop Entry]

Output of ls -lha .local/share/applications/intellij.desktop:

-rwx--x--x 1 alex alex 248 Dez 30 10:54 .local/share/applications/intellij.desktop

Answers posted to a previous question (How can I add custom '.desktop' application launchers to Ubuntu Dock?) don't work for me. I can find this launcher in Activities and I can double click on that file and IntelliJ will start. Nevertheless, I cannot add this launcher as a favorite to the dock. The option does not show up.

  • All of the responses here are how to set the favorites. I don't see any responses about how to add one without having prior knowledge of what favorites are there. askubuntu.com/questions/1193496/… This question might be helpful to people in my situation. Jun 11, 2020 at 20:41

5 Answers 5


Open Terminal and run

gsettings get org.gnome.shell favorite-apps

You should get the list of .desktop files associated to the apps pinned to Ubuntu dock in order, something like the following:

['appname-1.desktop', 'appname-2.desktop', 'appname-3.desktop', 'appname-4.desktop', 'appname-5.desktop']

Suppose you want to pin the app associated to the intellij.desktop file as the second item in the dock. In that case, run

gsettings set org.gnome.shell favorite-apps "['appname-1.desktop', 'intellij.desktop', 'appname-2.desktop', 'appname-3.desktop', 'appname-4.desktop', 'appname-5.desktop']"
  • 2
    This works! But when I start the app, another app icon appears. imgur.com/a/8GZ7j
    – kerner1000
    Jan 4, 2018 at 18:06
  • 7
    @kerner1000 Try this: askubuntu.com/a/975230/480481 from step 4 onwards
    – pomsky
    Jan 4, 2018 at 18:15
  • 2
    Works! Thanks a lot! I got acutally two strings back from xprop, I used the second one (jetbrains-idea-ce).
    – kerner1000
    Jan 4, 2018 at 18:43
  • It may be more user-friendly to put it this way: wherever you put a .desktop file, make it executable and trustable when clicking to open it, then right-click on the icon in the dock and add to the favourites.
    – funicorn
    Jan 6, 2018 at 3:39
  • 1
    @funicorn As per OP, the others methods (e.g. Add to favourites) mentioned in older questions are not working for them. That's why they asked a new question.
    – pomsky
    Jan 6, 2018 at 7:04

The answer from @pomsky is correct, but there is an easier way: use


(install it with sudo apt-get install dconf-editor if not installed) and navigate to


There it is possible to edit and rearrange the Launcher.


This can happen when the StartupWMClass doesn't correspond to the WMClass of the application. See this question for details on how it works and how to find the WMClass. In my case, setting the correct StartupWMClass in the .desktop file fixes this issue.


If you want to set the favorites system-wide for all users, there is a guide on Gnome's website (under the heading Set the same favorite applications for all users):

  1. sudo nano /etc/dconf/profile/user

  2. Ctrl + X, Y, Enter

  3. sudo mkdir /etc/dconf/db/local.d/
    sudo nano /etc/dconf/db/local.d/00-favorite-apps
    # Default favorites for all users
    favorite-apps = ['docker-desktop.desktop', 'org.gnome.Nautilus.desktop', 'firefox-esr.desktop', 'github-desktop.desktop', 'org.gnome.Settings.desktop', 'gnome-system-monitor.desktop', 'org.gnome.Terminal.desktop', 'org.gnome.TextEditor.desktop', 'gnome-tweaks.desktop']
  4. Ctrl + X, Y, Enter

  5. sudo dconf update

  6. Logout > Login

  7. Observe that the Favourite Applications menu has now been changed to:

    • Docker Desktop
    • Files
    • Firefox ESR
    • GitHub Desktop
    • Settings
    • System Monitor
    • Terminal
    • Text Editor
    • Tweaks

It is also possible to lock the favorites from being edited:

  1. sudo nano /etc/dconf/db/local.db/locks/favorite-apps

    # Lock default favorite applications
  2. Ctrl + X, Y, Enter

  3. dconf update


  • I did this on Debian not Ubuntu, so the app names could differ
    • I am told that org.gnome.Settings.desktop should read gnome-control-center.desktop on Ubuntu
  • Apps with the wrong name (precisely correct) will not appear in the menu

In my case the file was initially named idea.desktop

I had to rename it to jetbrains-idea.desktop to get this to work

I realized this since hovering over the icon on the dock shows a tooltip of jetbrains-idea

sudo mv /usr/share/applications/idea.desktop /usr/share/applications/jetbrains-idea.desktop

You must log in to answer this question.

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