3

I installed one application in /opt (simply untarring) and had to create my own .desktop file:

[Desktop Entry]
Type=Application
Terminal=false
Name=IntelliJ IDEA
Icon=/opt/IntelliJ/bin/idea.svg
Exec=/opt/IntelliJ/bin/idea.sh

However, the application icon in the side bar does not offer Add to Favorites when right-clicked.

enter image description here

How can I enable that option?

amphibient
  • 1,287

3 Answers3

5

I was facing this problem and I will share my notes in case it helps someone.

  • If the .desktop file is for all users to use then it should be placed under /usr/local/share/applications.
  • If the .desktop file is only for the current user then it should be placed under ~/.local/share/applications.
  • The .desktop file placed as above does not need execute permissions. It can be 0644.
  • If the .desktop file has a key Hidden then it should be Hidden=false.
  • If the .desktop file has a key NoDisplay then it should be NoDisplay=false.
  • The Exec key should have a valid command. Bash commands may not work as detailed in this answer.

With these settings in place the desktop entry should be searchable using the Super key, and from there using the Right Click -> Add to Favorites option, it can be setup as a favorite on the dash.

Note: In the above bullet points, "Has a key" means if the key is present in the config file. Alternatively, it can be absent, in which case the default value for that key takes effect.

Dhwani Katagade
  • 383
  • 5
  • 11
2

You can manually add your launcher using the command line.

dconf read /org/gnome/shell/favorite-apps to output a string representing the current favorites, e.g. ['firefox.desktop', 'org.gnome.Nautilus.desktop']

Copy the string and add your new launcher to the list. Run this to update your favorites:

dconf write /org/gnome/shell/favorite-apps "['firefox.desktop', 'org.gnome.Nautilus.desktop', 'YourManualApp.desktop']"

1

Your .desktop file should reside in ~/.local/share/applications or in an applications folders under one of the directories in the XDG_DATA_DIRS environmental variable.

Thus, for your custom application, install the file under ~/.local/share/applications if you are the only one needing to see the application in your user menu, or in /usr/local/share/applications to make it available for all users.

Once properly installed, you will also be able to add the launcher to your favorites.

vanadium
  • 97,564