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

Thread: How To Change File-Type (mimetype) Icons

  1. #1
    Join Date
    Sep 2005
    Location
    UK.
    Beans
    86
    Distro
    Ubuntu 8.04 Hardy Heron

    How To Change File-Type (mimetype) Icons

    How To Change File-Type (mimetype) Icons

    This how-to is based on wanting to change icons which have been downloaded from Gnome-look or some other source. As an example, I'll show how to change the icons associated with .doc and .odt files. Exactly same method applies to other file types.

    (If you're using the icons supplied with Ubuntu, you'll find them in /usr/share/icons. Also, if the iconset you're modifying is based on scalable .svg icons, the procedure will differ - find the icon to change in the "scalable" folder and replace with new .svg image)


    1. Open up a folder containing files with icons you want to change.
    2. Right-click on an icon and select Properties
    3. Look for the MIME type entry and make a note of it:
      e.g. application/msword (for .doc file)
      or application/vnd.oasis.opendocument.text (for .odt file)

    4. Navigate to ~/.icons folder. You'll see all the custom icon sets you've installed.
    5. Open up the icon folder you're using and you'll see that there are several folders containing the same icons at different sizes. In the Nautilus file manager, you can zoom in or out, increasing or decreasing the size of the icons displayed - these folders of icons make that possible. The size of icon vs zoom level is as follows:

      400% - 128x128
      200% - 96x96
      150% - 72x72
      100% - 48x48
      67% - 32x32
      50% - 24x24
      33% - 16x16

      (There are also icon folders 64x64 and 24x24 - not sure what they're used for!)
    6. Make seven versions of the image you want to use in the sizes listed above and copy into each folder.
    7. You'll have to repeat the next bit for each size:

      Open folder
      Look for file corresponding to mimetype entry you noted down earlier
      e.g. application/msword = application-msword.png
      or application/vnd.oasis.opendocument.text = application-vnd.oasis.opendocument.text.png
      Delete existing file
      Find the image file you copied in here earlier, right-click, Properties, Permissions tab.
      Click on the "Execute" tick box and "OK"
      Right-click on image file, Make link to to create a new link file.
      Rename the link to replace the file you deleted.

      Repeat for each icon size.

    8. When you've finished replacing icons, delete the "icon-theme.cache" file.
    9. Open a terminal and do:
      # cd .icons
      # gtk-update-icon-cache ICONSET NAME
      This will re-generate the icon-theme.cache file using your new icons.

      That's about it. Open up a new Nautilus window and enjoy icon nirvana!!!

      Someone who's done a bit of script writing could easily use this method, add a little front end via Nautilus-extensions to select an image, auto-rescale to the different sizes, apply, regenerate files and we'd all have an easy way to change file-type icons from the GUI. Anyone fancy a go?
    Last edited by dangermouse28; October 13th, 2008 at 10:39 AM.

  2. #2
    Join Date
    Aug 2006
    Beans
    2

    Re: How To Change File-Type (mimetype) Icons

    thanks

    sorry... but theres an error, the line
    # gtk-icon-cache-update ICONSET NAME
    should be:
    # gtk-update-icon-cache ICONSET NAME
    Last edited by pharrell; October 10th, 2008 at 10:38 PM.

  3. #3
    Join Date
    Sep 2005
    Location
    UK.
    Beans
    86
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How To Change File-Type (mimetype) Icons

    Thanks - my deliberate mistake has now been corrected!

    Well noticed

  4. #4
    Join Date
    Apr 2006
    Beans
    Hidden!

    Re: How To Change File-Type (mimetype) Icons

    Thanks for it, but I can't make it work. I don't want to replace the icon for an extension. I want to add icon for a new extension. I'm using the UbuntuStudio icon set, and after running the command:
    # gtk-update-icon-cache ICONSET NAME
    I get this error
    gtk-update-icon-cache: No theme index file.
    I've checked and the iconset name is correct. I don't know what's going on. Any help will be appreciated

  5. #5
    Join Date
    Sep 2005
    Location
    UK.
    Beans
    86
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How To Change File-Type (mimetype) Icons

    Hmm - I haven't tried to add a new icon for a new extension, although I have a feeling it's a bit more complicated than just adding a new icon - you'd have to create the rule under which that icon is displayed, give it a specific system name etc etc.

    As to your other problem, you need to be in the icon set folder (where the index file is located) before using that command.

  6. #6
    Join Date
    Feb 2009
    Beans
    1

    Re: How To Change File-Type (mimetype) Icons

    Use assogiate instead - download with synaptic.

  7. #7
    Join Date
    Nov 2008
    Location
    San Gabriel Valley
    Beans
    263
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How To Change File-Type (mimetype) Icons

    I prefer editing the desktop files located at:

    Code:
    /usr/share/applications
    /usr/local/share/applications
    before updating the databases:

    Code:
    update-mime-database /usr/share/mime
    update-mime-database /usr/local/share/mime
    update-desktop-database /usr/share/applications
    update-desktop-database /usr/local/share/applications
    NetBSD 64-bit + Xfce
    ArchLinux 64-bit + JWM

  8. #8
    Join Date
    Jan 2008
    Beans
    185
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How To Change File-Type (mimetype) Icons

    Assogiate doesn't work for me...I make the mimes and everything and it doesn't work.

    For example, I made a TODO mimetype, with a TODO* file pattern and a custom icon. I closed assogiate and afterwards created an empty TODO file. No icon was assigned, but at least the mimetype was detected. I right-clicked on properties and it said it was, as I asigned it, an x-todo file.
    **America != USA | American != Usanian**
    Own a Dell XPS M1530? Join the group!

  9. #9
    Join Date
    Jan 2009
    Location
    Tbilisi, Georgia
    Beans
    38
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How To Change File-Type (mimetype) Icons

    I have similar issu that woil.Can anyone assist?

  10. #10
    Join Date
    May 2009
    Location
    Atlanta, GA
    Beans
    22
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: How To Change File-Type (mimetype) Icons

    I'm having trouble with the last step:
    cd .icons
    gtk-update-icon-cache ICONSET NAME

    It's telling me "No theme index file"

    I copied a theme index file from /usr/share/icons/gnome to .icons, but that didn't help.

    Could someone tell me what I'm doing wrong?

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
  •