How can I change a mimetype icon for certain files?

Forum rules
Before you post please read how to get help
Post Reply
mark1mint
Level 3
Level 3
Posts: 143
Joined: Tue May 22, 2012 4:36 pm

How can I change a mimetype icon for certain files?

Post by mark1mint » Thu Jan 22, 2015 11:24 am

I'd like to change the mimetype icon for .xpi files (Firefox extensions), in older Ubuntu releases it was the generic package-x-generic.svg icon, now in current Ubuntu/Mint releases it is a generic "empty file" type of icon (at least in MATE) : after checking /etc/mime.types the application/x-xpinstall entry is there, so I suppose it is a matter of associating the icon I want to that mimetype, is that correct?
Is it enough to drop a link pointing to package-x-generic.svg icon inside the /usr/share/icons/gnome/scalable/mimetypes directory, where apparently all other similar icons are placed?

pasu
Level 1
Level 1
Posts: 18
Joined: Sun Nov 21, 2010 9:46 am

Re: Hw can I change a mimetype icon for certain files?

Post by pasu » Tue Feb 24, 2015 3:14 pm

mark1mint wrote:I'd like to change the mimetype icon for .xpi files (Firefox extensions), in older Ubuntu releases it was the generic package-x-generic.svg icon, now in current Ubuntu/Mint releases it is a generic "empty file" type of icon (at least in MATE) : after checking /etc/mime.types the application/x-xpinstall entry is there, so I suppose it is a matter of associating the icon I want to that mimetype, is that correct?
Is it enough to drop a link pointing to package-x-generic.svg icon inside the /usr/share/icons/gnome/scalable/mimetypes directory, where apparently all other similar icons are placed?

It depends on which theme you are using. For example, I am using the UltimateGnome theme. Whenever I need to change mime icon, I drop a svg of that type to /usr/share/icons/UltimateGnome/scalable/mimetypes directory. In a newly installed Mint, if you have the previewable files set to yes, recently changes mime icons will not take effect until the thumbnails cache has built up.

Right clicking the xpi you will see something like: application/x-xpinstall, so the icon name will be application-x-xpinstall.svg (simply change the / to -). I am not sure if you can drop in a link pointer but you can try. I usually find the icon I like in png format (which is easier to find), and then just change the extension to svg. I will not be able to see what the image is in svg extension and I think it's because it is not a real svg file, but it works. I believe it might be a better idea to actually spend some time to convert the pngs to svgs using some program.

Hope it helps.

mark1mint
Level 3
Level 3
Posts: 143
Joined: Tue May 22, 2012 4:36 pm

Re: How can I change a mimetype icon for certain files?

Post by mark1mint » Tue Mar 03, 2015 3:26 pm

Thank you very much, this is very useful information, for instance I didn't imagine that you could simply rename a png icon to svg .

Thinking of it, I may have missed the right folder where to drop the icon/symlink, as I'm bit confused between mate and gnome folders (I have both in /usr/share/icons in Mint 13 Mate) - also, the thumbnails cache may need to be rebuilt, I wonder if there's a way to force this, short of deleting the .thumbnails directory.

pasu
Level 1
Level 1
Posts: 18
Joined: Sun Nov 21, 2010 9:46 am

Re: How can I change a mimetype icon for certain files?

Post by pasu » Fri Mar 20, 2015 5:37 pm

mark1mint wrote:Thank you very much, this is very useful information, for instance I didn't imagine that you could simply rename a png icon to svg .

Thinking of it, I may have missed the right folder where to drop the icon/symlink, as I'm bit confused between mate and gnome folders (I have both in /usr/share/icons in Mint 13 Mate) - also, the thumbnails cache may need to be rebuilt, I wonder if there's a way to force this, short of deleting the .thumbnails directory.
No problem. Glad it helped. Renaming png to svg is not a perfect solution since it does not convert the png to svg file type. However it works and I am happy with that. I do not know whether or not there is a command to rebuild icon cache. What I usually do when I need to rebuild cache is by deleting the ~/.cache/thumbnails folder. It takes a while to build the cache since I have many files.

Post Reply

Return to “MATE”