24

I have created a custom application entry in the applications menu for Eclipse as follows in a file /usr/share/applications/eclipse.desktop as follows

[Desktop Entry]
Version=1.0
Name=Eclipse   
Exec=/usr/local/eclipse/eclipse
Terminal=false
Type=Application
StartupNotify=true
Categories=X-Red-Hat-Extra;Application;Development;
X-Desktop-File-Install-Version=0.15
Icon=/usr/local/eclipse/icon.xpm

This now appears fine in the Programming section of the Applications menu.

How can I add it to the Favorites section?

Vihung
  • 365
  • 1
  • 3
  • 8

2 Answers2

23

No need to edit files.

Sometimes you can't just add the application's launcher to the activity menu because it isn't recognized as an activity.

go to the folder containing the .desktop file you wish to add to the favorites bar and open the terminal there. run the command sudo mv path/to/file/name.desktop /usr/share/applications

after that you should be able to view the launcher in the activities list and easily add it to the favorite menu :)

ValarMorghulis
  • 515
  • 1
  • 4
  • 12
  • As an alternative in Debian you may need to click on the 'show applications'/launcher, and then right click the application there, to add it to the favorites bar – n00b Apr 18 '17 at 18:17
  • 1
    Thanks for mentioning 'activities list ' - That was the most convoluted way to add a shortcut - boy oh boy does Centos have a lot of catching up to do just to be user-friendly! – killjoy Dec 15 '17 at 16:40
  • @killjoy This is more of a Gnome thing, not so much Centos (came here with Ubuntu) – Josh Morel Mar 31 '18 at 22:11
  • 4
    Alternatively, if this application is only installed for the current user, it would be more appropriate to put the `.desktop` file in `~/.local/share/applications` – MDMower Jul 24 '18 at 21:23
  • I have the .desktop file in both `/usr/share/applications` and also in `~/.local/share/applications` but still it does not work – Kiran K Telukunta May 28 '21 at 09:30
22

The favourite in Gnome Classic view follows the favourites in the Gnome 3 shell.

Click on Activities in the top-left corner or use your keyboard's Windows button if it has one, to bring up the activities overview. Right-click on one of those activities and Add to Favourites.

It should now be visible in the Gnome Classic Favourite menu.

garethTheRed
  • 33,289
  • 4
  • 92
  • 101
  • Thanks. That worked. I expected that I could add an entry in the `.desktop` file – Vihung Dec 04 '14 at 10:30
  • 2
    Doesn't work for me for own .desktop files (even if installed) - I then get only the window title when right-clicking. Works for all other apps, though. – AndiDog Oct 28 '15 at 08:36
  • 2
    Same for me: How can I add my own .desktop items? I'd like to add a shortcut for Intellij. – Gregor Dec 22 '15 at 07:34
  • @AndiDog Just a note in case you haven't found the solution yet: gnome seems to require the .desktop file to be named exactly the same as the started application: https://unix.stackexchange.com/a/59654/19705 – codeling Jun 04 '17 at 08:54
  • You need to [add the `StartupWMClass`](https://unix.stackexchange.com/a/390904/24036) to the `eclipse.desktop` file. – BuZZ-dEE Sep 07 '17 at 09:17
  • @AndiDog I added my own application via alacarte (which might not be important). If I open Activities and go to 'Show applications' in the dock bar I see a list of applications, including my own added one. I can right click on the entry of my application and add it to favourites. First I tried the right click in the dock bar. There I also saw just the title. Using Gnome 3.22 with CentOS 7. – robsch Jul 02 '18 at 11:44
  • After copying it to `~/.local/share/applications` I can then add it to favorites. @Gregor and @AntiDog – WesternGun Nov 02 '22 at 07:37
  • i have only applications, and no activities at all. what works for ubuntu custom shell - doesnt work at all for gnome classic shell. On bottom bar i have window list (15 opened vscode sessions) and windows key allows to switch between those sessions.. gnome 3 classic.. So, sorry but this can't be considered as an answe at all.. only maybe for default installation where you still have access to this useless inconvinient activity panel, that isnt working well at a real scale.. – xakepp35 Feb 07 '23 at 17:43