Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

To the best of my knowledge, all shortcuts in the Unity Launcher have a corresponding *.desktop file. I have one shortcut (for skrooge) that doesn't have an icon. How can I find the *.desktop file corresponding to this shortcut so that I can add an icon to it?

share|improve this question

2 Answers 2

up vote 21 down vote accepted

It's probably sitting in /usr/share/applications/ but if you want to find every .desktop file on the system run this:

find / -name '*.desktop'

or

sudo updatedb
locate *.desktop

To find files with "skrooge" in their path or name, add a grep to the command:

locate *.desktop | grep -iR "skrooge"
share|improve this answer
5  
locate -i "*skrooge*.desktop". Though there's mainly three places unity will look for desktop files. ~/.local/share/applications, /usr/local/share/applications and /usr/share/applications. If there are desktop files for the same command in multiple places, it'll use the left-most of the three I listed. –  geirha Mar 30 '12 at 14:32
    
Showed up as /usr/share/applications/kde4/skrooge.desktop. Thanks. :) –  Koviko Mar 30 '12 at 15:08

The system stores the .desktop files in /usr/share/applications/. Unfortunately, if you open that folder in nautilus the .desktop files appears with the icon specified in the file and with the file name called out within the file. You also won't be allowed to edit these files by clicking on them and selecting edit.

To edit these files, you need to open that folder within a terminal window. Doing an ls command will show all the .desktop files with their actual names. When you locate the .desktop you wish to change, run gksudo gedit {file-name}.desktop.

It's normal practice to keep any .desktop files you create or edit in your home folder ~/.local/share/applications.

share|improve this answer
    
Running from the terminal can be handier for some, but it is also possible to drag from nautilus into gedit or another text editor. –  Jon Hanna May 1 at 21:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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