Score:0

"Add to Favorites" not available for manually created desktop item

br flag

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?

James Newton avatar
us flag
I don't have an answer, but some people may benefit from this documentation on the format of desktop files: https://developer-old.gnome.org/desktop-entry-spec/ https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#introduction
Score:1
cn flag

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.

James Newton avatar
us flag
This advice does not work on Ubuntu 18.04
James Newton avatar
us flag
@vanadium I literally used a working desktop file which I could set as a favorite, did nothing more than change the executable to a different (and very executable) program in the same folder, and copied it to /usr/local/share/ which is in my XDG_DATA_DIRS path. And after running that executable, there is no option to set it as a favorite. I ended up renaming the new program to the same name as the old program so that I could use the working desktop file.
amphibient avatar
br flag
I don't even have `applications` under my `/usr/local/share`
vanadium avatar
cn flag
Nobody said you would. If you don't, make it. Indeed it is not there by default.
amphibient avatar
br flag
moving it to `/usr/local/share/applications` and logging back in to reload the KDE -- did not work.
Score:0
us flag

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.

Score:0
it flag

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']"

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.