How can I change a mimetype icon for certain files?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mark1mint

How can I change a mimetype icon for certain files?

Post by mark1mint »

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?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
pasu

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

Post by pasu »

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

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

Post by mark1mint »

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

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

Post by pasu »

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.
Locked

Return to “MATE”