Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: HOWTO: Change icon for specific file types in Gnome

Hybrid View

  1. #1
    Join Date
    May 2006
    Beans
    Hidden!

    HOWTO: Change icon for specific file types in Gnome

    This works in Gnome 2.16.1, which is the default version used in Ubuntu Edgy.

    I spent several hours looking for a way to so this, but everything I found on google was for old versions of gnome and didn't seem to work anymore.

    It turns out that it's very simple to do this so here's the guide step-by-step:


    How to change the icon for a specific file type in Gnome
    --------------------------------------------------------

    1) Go to the folder where your icon theme is installed. Mine is in ~/.icons/Vista-Inspirate_1.0

    2) Look for a subfolder called "mimetypes". In the case of Vista Inpirate (the icon theme I use), there is no such folder so I had to create one. I created mine in "48x48/mimetypes" so the full path of the folder is ~/.icons/Vista-Inspirate_1.0/48x48/mimetypes

    3) Inside this folder, copy the icon/image you want to use for a specific file type. In my case, I wanted to create an icon for Mathematica notebooks which have extension "*.nb" so I renamed my png picture to the following: gnome-mime-application-mathematica.png. The name depends on the mime type you are trying to change so look for the mime type of your file and name it accordingly.

    4) Log out and log back in so that your icons are refreshed. Now all the files with the specific extension you changed (*.nb in my case) have the correct icon.


    That's it!

    Enjoy your new icons...

  2. #2
    Join Date
    Apr 2006
    Beans
    10
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO: Change icon for specific file types in Gnome

    Where did you get that Mathematica icon from or did you create one of your own?

    Thanks, Peter

  3. #3
    Join Date
    May 2006
    Beans
    Hidden!

    Re: HOWTO: Change icon for specific file types in Gnome

    I made my own icon using Export in Mathematica.

  4. #4
    Join Date
    Oct 2004
    Beans
    2,324

    Re: HOWTO: Change icon for specific file types in Gnome


    Uauu! I had managed to get Mathematica icons once changing a lot of text config files referring to mime types and app to deals with nb extensions... a perfect nightmare that i could never repeat successfully on recent gnome versions.

    And it was so easy after all... Many, many thanks lllSpylll.

    May i give one or two suggestions? A nice thing is to add good scaled icons to all sizes mimetypes folder, so when you change the size of view (e.g. pressing ctrl +) it won't look bad or unfocused. I start to add a png with 128x128 to 128x128/mimetype/ and then scale it with gimp to 96x96 and save it on 96x96/mimetypes and so on.

    A nice way to get a good nb-file icon is simply edit the file mimetype/gnome-fs-regular.png and add over it a mathematica icon/image and save it, of course, as gnome-mime-application-mathematica.png. That will make it distinct of an icon from a launcher and will be better integrated with the rest of the icons theme.

    For those who don't have the artistic vein for Mathematica or Gimp, you can check wolfram's graphics gallery and search for nice images to use as icons.


    Again thanks,
    ___________________________________
    ESTRAGON: We've lost our rights?

  5. #5
    Join Date
    May 2006
    Beans
    Hidden!

    Re: HOWTO: Change icon for specific file types in Gnome

    Very nice suggestions.

    Basically, as Rui Pais suggested, you can add icons for all sizes, using the same strategy.

    Very nice indeed.

    Thanks Rui

  6. #6
    Join Date
    Oct 2006
    Beans
    149

    Re: HOWTO: Change icon for specific file types in Gnome

    There is one thing that I am not understanding.
    From what is posted, the gnome will recognize the files with the name gnome-mime-application-mathematica.png as the icon for the *.nb files.
    Where is this relation between the file extentions and the icon file names? For example, If I want to use some icon for the files with extention '*.foo', what name should I give to the icon picture file?
    Other related question, where do I define the application that opens (by default) the files with a specific extention?
    Thank you

  7. #7
    Join Date
    Sep 2006
    Location
    Africa
    Beans
    33
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO: Change icon for specific file types in Gnome

    Anybody know any good links for icons?

    Apart from gnome-look or kde-look.


    Thanks.

  8. #8
    Join Date
    Nov 2005
    Location
    Where do I live
    Beans
    327

    Re: HOWTO: Change icon for specific file types in Gnome

    I would also like to know how to associate mime-types. Fontforge fonts immediately some to mind.

  9. #9

    Question Re: HOWTO: Change icon for specific file types in Gnome

    It's a bit tricker than replace a file

    Heres the spec

    http://standards.freedesktop.org/sha...ec-latest.html

    and an example (not completly correct but you get the idea)

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
    	<mime-type type="application/msword">
    		<comment>MS Word Files</comment>
    		<glob pattern="*.doc"/>
    	</mime-type>
    </mime-info>
    Save in
    Code:
    ~/.local/share/mime/packages/ms-word-files.xml
    Then run
    Code:
    update-mime-database ~/.local/share/mime/
    Note using file magic is usually a better idea then file extensions see the spec for more detail

  10. #10
    Join Date
    May 2006
    Beans
    Hidden!

    Re: HOWTO: Change icon for specific file types in Gnome

    To Carlos Santiago,


    I think your first question was answered by KillerKiwi.
    For the second question, the answer is simple:

    Right click on the file and choose "Open with Other Application..."
    Then select the application you want to open that kind of file.

    You can select the default application by right clicking the file and choosing Properties -> Open With


    I hope this helps.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •