21

I have a custom .desktop file:

[Desktop Entry]
Type=Application
Terminal=false
Icon[en_US]=/home/alex/bin/idea-IC-173.4127.27/bin/idea.png
Name[en_US]=IntelliJ
Exec=/home/alex/bin/idea-IC-173.4127.27/bin/idea.sh
Name=IntelliJ
Icon=/home/alex/bin/idea-IC-173.4127.27/bin/idea.png

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

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.

Answers posted to a previous question (Can't add Custom .desktop files to dock 17.10) don't work for me.

25

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']"
  • This works! But when I start the app, another app icon appears. imgur.com/a/8GZ7j – kerner1000 Jan 4 '18 at 18:06
  • 3
    @kerner1000 Try this: askubuntu.com/a/975230/480481 from step 4 onwards – pomsky Jan 4 '18 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 '18 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 '18 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 '18 at 7:04
9

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

dconf-editor  

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

org/gnome/shell/favorite-apps.

There it is possible to edit and rearrange the Launcher.

0

The Dash-to-Dock extension for gnome3 allows adding the program to your favourites from the context menu.

  1. Install the latest version of Dash-To-Dock
  2. Start the application from command line
  3. Right click the application on the dock and select "Add to favourites"
  4. Close the application and launch it from the dock

Worked for me with PyCharm Pro.

  • Favorite button does not appear here – JonLord Sep 27 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.