How do I create a new MIME type for an unregistered extension and add an icon to it?

Good day to all. About two days ago I asked a question.

The guy below suggested that I was interested in MIME types of file extensions. And gave a link to Icons - ArchWiki.

I started reading “Icons - ArchWiki” and after a while got to MIME-types specification. I continued to read the MIME-types specification and when I got to the section “The icon files” I tried to register a new file MIME-type with extension .scss in directory ~/.local/share/mime/packages and then I ran the command:

update-mime-database ~/.local/share/mime

but it didn’t make a difference.

I still don’t understand how to specify a link to the icon in the xml file, so that when the system detects that this ( name_file.scss ) file has the extension .scss, what would it refer to the corresponding file with the MIME type and it already gave the icon to the file with the .scss extension.

I don’t understand exactly how the whole mechanism works, described as I understand it now. I hope, that some people will help me to understand MIME file types.

I’m waiting for developers, if available and if they can suggest something. Or just at least explain the scheme of how the whole thing works.

I am waiting for anyone with good advice on the subject! :fist: :saluting_face:


P.S. and yes if you ever do something like this, be sure to take pictures via timeshift or any other program to create system restore files. During these two days I screwed up a lot and timeshift helped me out more than three times. :upside_down_face:



Links to stuff I’ve read and tried to do:
Icons - ArchWiki
MIME-types specification

XDG MIME Applications - here is some information about creating separate MIME-types for each user in the ~/.local/share/mime/ folder

Thanks to one dude’s advice from this article. For the advice to create a directory /mime/packages if it doesn’t exist:


2 posts were merged into an existing topic: How to make so that my icon would be added to a certain file extension which is not indexed in the system?