If you have any problems, please search for [a similar issue] first, before creating a new one (don't forget to follow the issue template).
Also, check the list of known issues before doing so.
Don't forget to provide your environment details: just choose A File Icon: Environment in Command Palette and copy them.
The CairoSVG dependency needs the cairo library being present on the system.
Linux
sudo apt-get install libcairo2 uvWindows
You can download the latest release of cairo.dll and place it somewhere Python can load it from.
As a last resort, Graphviz includes cairo.dll in its distribution.
Navigate to A File Icon root directory and call...
uv sync --devNavigate to A File Icon root directory, activate python virtual environment and call...
# build everything
uv run build
# build icons only
uv run build --icons
# build icon theme files only
uv run build --themeIf you want to add a new icon, please follow these steps:
- Try to find an icon in one of these resources. We always try to be pretty similar to Atom File Icons package. If you are unable to find anything – add your own.
- Add an example file that shows this icon to the
testsfolder. - Provide the icon in SVG format and put it in the
icons/svgdirectory. - Add icon settings to the icons/icons.json file.
- Build and check if the icon looks good (Run A File Icon: Revert to a Freshly Installed State after build to apply your icon).
- It's recommended to add a link to the package which provides the syntax (see PACKAGES.md)
All that you need to add are the SVG icon, its settings and the example file(s).
All settings should be alphabetically sorted.
Please do not change any other files - specially in
icons/coloredandicons/monofolders.
Requirements:
- The size should be
16x16(viewBox). - The color should be black via
fill="#000"attribute. - You should build and check if it looks good. If not, make some tweaks to fit the pixel grid.
Example:
<svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" fill="#000" viewBox="0 0 16 16">
<path d="M11.174,9.341A2.586,2.586,0,1,1,9.345,6.176,2.586,2.586,0,0,1,11.174,9.341Zm1.389-1.713A6.757,6.757,0,0,1,12.6,4.2,2.639,2.639,0,0,0,7.5,2.879,6.749,6.749,0,0,1,5.958,5.7a6.41,6.41,0,0,1-3,1.766,2.641,2.641,0,1,0,1.368,5.1,6.349,6.349,0,0,1,3.309-.016,6.782,6.782,0,0,1,2.985,1.776,2.611,2.611,0,0,0,3.609-.108,2.639,2.639,0,0,0,.09-3.631A6.786,6.786,0,0,1,12.562,7.628Z"/>
</svg>Icons are applied in two different ways:
- by
<Name>.sublime-file-iconsfiles bypassing any syntax definitions. - by scope defined by syntax definitions, if no icon theme is selected or file extension is not specified in active file icon theme.
Icon themes are generated by uv run build --icons, using icons/icons.json metadata.
{
"file_type_awk": {
"color": "red",
"syntaxes": [
{
"extensions": [
"awk"
],
"name": "Plain Text (AWK)",
"scope": "source.awk"
}
]
}
}Note
"name" and scope remain for historic reasons, but they are no longer evaluated.
Generated icon themes contain mappings for all extensions listed in "extensions": [] nodes. The entry above, produces following entries in A File Icon.sublime-file-icons file.
{
"icons": {
"AWK": "file_type_awk",
"awk": "file_type_awk"
}
}Note
Extensions are evaluated case-sensitive even on case-insensitive filesystems.