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.

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

I referred:

http://askubuntu.com/a/78645/78407

http://askubuntu.com/a/56725/78407

and

https://help.ubuntu.com/community/AddingMimeTypes

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

enter image description here

share|improve this question

1 Answer 1

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: https://help.ubuntu.com/11.04/ubuntu-help/nautilus-prefs.html.

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. –  green7 Aug 21 '12 at 9:16

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.