Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to find the icon for a specific file type? I'd like to write a shell script that returns the location of the image file, or icon, for a specific file type.

share|improve this question

In python, you could can get the icon with something like:

>>> from gi.repository import Gio
>>> Gio.content_type_get_icon('text/python')
<ThemedIcon object at 0xb5d61324 (GThemedIcon at 0xa372590)>
share|improve this answer
How can I find the name and location of the icon image's file? I don't see any file names being printed here. – Anderson Green Nov 25 '12 at 3:43

Your Answer


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.