155

I'd like to know which folder the Unity Launcher .desktop files are stored in, as they're not anymore in /.gconf/desktop and I need to add a custom application to the launcher bar (adding it in /usr/share/applications doesn't seem to be enough).

Where are the Unity Launcher .desktop files?

Flyk
  • 1,480
  • 3
  • 18
  • 24
Tigull
  • 3,571
  • 5
  • 25
  • 31
  • Related: [Where are the .desktop icon files stored?](https://askubuntu.com/questions/217331/where-are-the-desktop-icon-files-stored) – Eliah Kagan Jun 20 '19 at 01:50

6 Answers6

201

Globally in

/usr/share/applications 

Locally in

~/.local/share/applications

If you want to add a custom launcher, create it in ~/.local/share/applications, make it executable, drag and drop it on the launcher*, and finally pin it (right-click on the launcher item → Keep In Launcher).

* Opening it using Nautilus doesn't seem to do the trick.

muru
  • 193,181
  • 53
  • 473
  • 722
htorque
  • 63,950
  • 40
  • 194
  • 219
  • Actually, this way the custom icon is not shown but the application icon is instead. Any ideas on how to fix that? I also tried adding the .desktop through gconf-editor but I haven't found the Unity entry. – Tigull May 07 '11 at 08:24
  • You are right, that's probably a bug. Instead you can just drag and drop the .desktop file onto the launcher. To find the favorites list, install the `dconf-tools` package and run `dconf-editor`. The list is stored under *desktop → unity → launcher*. – htorque May 07 '11 at 08:32
  • 2
    You can manually specify the icon to use by adding the following line to the desktop file: `Icon=/absolute/path/to/image.png` – Dunes May 19 '15 at 12:19
  • 1
    Just a note that those using snaps may find them in /var/lib/snapd/desktop/applications/xyz.desktop – Jon Aug 03 '18 at 09:38
14

Unity 2D looks for .desktop files in the /usr/share/applications directory. This can be found by using the following in the Terminal:

locate firefox.desktop

For me it worked by adding one of the launchers that was already there (eg. gimp.desktop) using the following in the Terminal

gconf-editor

to add an entry to the favorites list under desktop/unity-2d/launcher.

enzotib
  • 92,255
  • 11
  • 164
  • 178
andersand
  • 241
  • 2
  • 4
  • I forgot about ```locate``` , thank you! ```/usr/local/share/applications/``` that'where the culprit was! – variona Nov 12 '16 at 07:53
7

This question was posted almost 9 years ago, but it still appears on top of searches on this topic. For completeness, since Snaps are now a thing, there are at least 4 locations:

Globally:

/usr/share/applications

/usr/local/share/applications/ (less common)

Locally:

~/.local/share/applications

Snaps:

/var/lib/snapd/desktop/applications
user2066480
  • 251
  • 2
  • 8
  • 1
    That's the correct answer today. At my side a snap was the culprit I wanted to override, and - of course - I grepped EVERYTHING but `/var` for it (everything of snaps are located in `/snap`, right? Nope, apparently it infects all drives!) – Tino May 02 '21 at 07:36
6

cd ~/.local/share/applications is the 1st place that is look in.

Examples from my directory that I used to add quicklists:

~/.local/share/applications$ ls
banshee.desktop           gnome-terminal.desktop
chromium-browser.desktop  mimeapps.list
firefox.desktop           nautilus-home.desktop
gedit.desktop             ubuntu-software-center.desktop
Rinzwind
  • 293,910
  • 41
  • 570
  • 710
4

Besides globally in /usr/share/applications, locally in ~/.local/share/applications, it also has in /usr/local/share/applications/. It has similar effects as globally. Some applications choose to put their desktop file in this folder.

beahacker
  • 321
  • 2
  • 6
3

I actually found a fix myself! It is necessary to create an entry in alacarte. To customise the icon you must manually edit the icon again from alacarte.

Tigull
  • 3,571
  • 5
  • 25
  • 31
  • That doesn't sound like the *right* solution, but more a workaround for a bug in either the launcher or the original .desktop file. – JanC Jun 09 '11 at 10:37