dangermouse28
September 11th, 2008, 04:05 PM
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)
Open up a folder containing files with icons you want to change.
Right-click on an icon and select Properties
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)
Navigate to ~/.icons folder. You'll see all the custom icon sets you've installed.
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!)
Make seven versions of the image you want to use in the sizes listed above and copy into each folder.
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.
When you've finished replacing icons, delete the "icon-theme.cache" file.
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?
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)
Open up a folder containing files with icons you want to change.
Right-click on an icon and select Properties
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)
Navigate to ~/.icons folder. You'll see all the custom icon sets you've installed.
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!)
Make seven versions of the image you want to use in the sizes listed above and copy into each folder.
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.
When you've finished replacing icons, delete the "icon-theme.cache" file.
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?