How to add file icon

When we create programming file like
Screenshot from 2020-07-23 14-40-54

Screenshot from 2020-07-23 14-43-51

it will create a file with icon that is related to particular programming language . like this how to add file icon to the system for other programming languages which do not show file icon .

can any one help me find the file locations were this icons are Situated so that i can copy and past file icons or help me to add more file icons

Its based on activated icons theme .

example for python file mime type.

2 Likes

You can add custom MIME types, or override system defaults with the following:

tee custom-mime.xml << "EOF" > /dev/null
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/x-python">
<generic-icon name="text-html"/>
</mime-type>
</mime-info>
EOF
sudo xdg-mime install --mode system custom-mime.xml

The MIME packages are stored here:

/usr/share/mime/packages
~/.local/share/mime/packages

Unpackaged icons should be stored to:

/usr/local/share/icons
~/.local/share/icons
1 Like