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.

In a .desktop file you can declare an icon, however it's not clear how this translates to an icon on disk:

Icon=eric  

Where on the filesystem can I find this icon?

Related to this question:

share|improve this question

1 Answer 1

up vote 3 down vote accepted

It's dependent on the icon theme. If the icon is not given by an absolute path, following rules are used to find the icon:

The lookup is done first in the current theme, and then recursively in each of the current theme's parents, and finally in the default theme called "hicolor" (implementations may add more default themes before "hicolor", but "hicolor" must be last). As soon as there is an icon of any size that matches in a theme, the search is stopped.

[...]

The lookup inside a theme is done in three phases. First all the directories are scanned for an exact match, e.g. one where the allowed size of the icon files match what was looked up. Then all the directories are scanned for any icon that matches the name. If that fails we finally fall back on unthemed icons. If we fail to find any icon at all it is up to the application to pick a good fallback, as the correct choice depends on the context.

See the Icon Theme Specification for details.

share|improve this answer
    
Sounds like an "effective icon path" shell script would be useful. ("ubuntu-which-icon eric" would return /path/to/eric.xpm as used by ubuntu unity desktop) –  Warren P Oct 16 '11 at 14:05
    
You can do that like described here: stackoverflow.com/questions/6090241/… Not sure there is a simpler way to do it (like an already existing command). –  htorque Oct 16 '11 at 14:10

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.