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

I am trying to change the icon for .py file.

I referred:


Still no success in changing the icon of python scripts. They remain like gedit icons.

enter image description here

share|improve this question
up vote 3 down vote accepted

As this Ubuntu wiki says:

The file manager creates thumbnails to preview image and video files, and can also preview text files and sound files......The icon for plain text files looks like a piece of paper with text inside. The file manager automatically extracts the first few lines of text from the file and shows it in the icon. You can turn this feature on or off, or turn it on only for files on your computer and local external drives.

To turn off the feature:

  • Open nautilus and go to Edit -> Preferences.

  • Go to the Previews tab and under the Text Files section, select the menu for Show text in icons and select Never.

  • Close the Preferences.

Nautilus Preferences

Now, we come to changing icons.

I've Faenza Icon Theme installed, so I go to /usr/share/icons/Faenza/mimetypes/scalable and there is already an icon file named text-x-python.svg, and the same shows for all the .py files.

If you've any icon theme installed you should go to the directory for that theme and make the changes, if not you should change the icons in the /usr/share/icons/gnome directory.

Additional Links: You can read more about File Manager Preferences here:

share|improve this answer
Thanks. I already had the icon. Just had to do that "Never" preview thing in nautilus... :) – Chirag Aug 21 '12 at 9:14
Glad it helped. – green Aug 21 '12 at 9:16

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.