Welcome to the guide for developing your own custom icon pack for Linux graphical environments. This brief article will provide detailed instructions and practical examples to help you create and implement a custom icon theme.
First, it is important to explain where icons are usually stored. There are many possible directories to store icon files, but the most common ones are:
- User Icons (
~/.icons/): Icons stored here are only accessible by the current user. - System Icons (
/usr/share/icons/): Icons in this directory are available to all system users. - Application Icons (
/usr/share/pixmaps/): Contains icons used by various applications and software packages.
Note
Applications typically look for icons first in ~/.icons/, then in /usr/share/icons/, and finally in /usr/share/pixmaps/.
Now that we've covered some of the directories, it's important to select one to start creating your icons. You can choose between the following:
- For personal use:
~/.icons/ - For global use:
/usr/share/icons/
Simply navigate to the chosen directory through the terminal or graphical environment and create a folder with your icon theme's name. For example, via the terminal, it would look something like this:
mkdir -p ~/.icons/YourThemeNameImportant
Replace YourThemeName with the desired name for your theme.
Inside your theme's directory, you need to organize the icons into categorized subdirectories. The most common structure is:
YourThemeName/
├── 16x16/
├── 22x22/
├── 24x24/
├── 32x32/
├── 48x48/
├── 64x64/
├── 128x128/
├── 256x256/
├── scalable/
├── cursors/
└── index.themeEach directory (except for cursors and index.theme) represents the icon size in pixels. Inside these directories, the icons are organized into categories such as:
actions: Actions (e.g., save, open);apps: Applications;devices: Devices;places: Places (e.g., folders, directories);mimetypes: File types;status: Status and notifications.
The scalable directory is commonly used to store SVG icons. However, nothing prevents you from allocating SVG files in other directories.
For example, the structure for 48x48 pixel icons would look like this:
YourThemeName/48x48/
├── actions/
├── apps/
├── devices/
├── places/
├── mimetypes/
└── status/Important
You can also structure your icon pack by first using the category names and then allocating the different sizes within these directories. Feel free to do whatever suits you best!
The index.theme file is essential for your icon theme. It serves as an index that defines the theme's properties and guides the system in locating the icons. Here’s a basic example of index.theme:
[Icon Theme]
Name=YourThemeName
Comment=Description of your icon theme
Example=folder
Directories=16x16/actions,16x16/apps,16x16/devices,16x16/places,16x16/mimetypes,16x16/status
# Repeat for other sizes and categories
[16x16/actions]
Size=16
Context=Actions
Type=Fixed
[16x16/apps]
Size=16
Context=Applications
Type=Fixed
# Continue for the other directories-
[Icon Theme]: General information about the theme.Name: The name of the theme.Comment: A brief description.Example: A representative icon name from the theme.Directories: List of directories included in the theme.
-
[<path to icon directory>]: Specific settings for each directory.Size: The size of the icons in the directory.Context: The context or category of the icons.Type: Icon type (Fixedfor fixed sizes,Scalablefor resizable SVGs).
For more details about the index.theme file, refer to the Freedesktop Icon Theme Specification.
The commonly used file formats for icons in Linux are:
- SVG: Scalable vector graphics, ideal for icons that need to be resized without losing quality.
- PNG: Raster images, suitable for fixed-size icons.
Tip
Other formats, like XPM, are also supported but are less common.
Let's create a custom application icon:
-
Choose the Size and Category:
- Suppose we want to create a 64x64 pixel icon for an application.
- The corresponding directory would be
YourThemeName/64x64/apps/.
-
Create the Directory if It Doesn't Exist:
mkdir -p ~/.icons/YourThemeName/64x64/apps/ -
Create the Icon:
-
Name the File Correctly:
- The file name should follow the Icon Naming Specification.
- For example, for a text editor, the name could be
accessories-text-editor.png.
-
Save the Icon in the Appropriate Directory:
- Place the file in
~/.icons/YourThemeName/64x64/apps/.
- Place the file in
If you're curious to see a complete list of icons, feel free to check out my repository Linux Icon Database. There, I've included the most common icons from the default themes that come pre-installed in most Linux-based graphical environments.
To simplify the creation process, consider using tools such as:
- Ikona: An application dedicated to icon design, available for Linux.
Install Ikona via Flatpak:
flatpak install flathub org.kde.Ikona flatpak run org.kde.Ikona
After creating your icon set, you need to apply it to your desktop environment:
-
GNOME:
-
Install the GNOME Tweaks application if you don’t have it yet:
sudo apt install gnome-tweaks # Debian/Ubuntu sudo dnf install gnome-tweaks # Fedora
-
Open GNOME Tweaks, go to "Appearance" and select your icon theme.
-
-
KDE Plasma:
- Go to System Settings > Appearance > Icons and choose the theme.
-
XFCE:
- Go to Settings > Appearance > Icons and select your theme.
-
LXQt:
- Go to System Preferences > Appearance > Icon Theme.
If the theme doesn’t appear immediately, try running this command to update the icon cache:
gtk-update-icon-cache -f ~/.icons/YourThemeNameIf the theme is in the /usr/share/icons/ folder, use:
sudo gtk-update-icon-cache -f /usr/share/icons/YourThemeNameTo help you get started, here are some useful templates:
- Base for Creating an Icon Theme (Example of the Paper theme)
index.themeFile Template (Official Freedesktop documentation)- Papirus Icon Set for Reference
Once you’ve created and tested your custom icon pack, you can share it with the community. Here are some popular platforms where you can publish your work:
Opendesktop.org is a popular platform for sharing themes, icons, and other Linux-related resources.
GitHub is a widely used code hosting platform that’s ideal for developers who want to share their projects and collaborate with others.
Pling.com is a platform that hosts a variety of content, including themes and icons for Linux.
DeviantArt is an online art community where many designers share their Linux themes and icons.
Creating a custom icon theme on Linux may seem challenging at first, but with this guide, you have all the basics to get started. From organizing directories to setting up the index.theme file, each step is crucial to ensuring a functional and stylish package.
If you have questions or want to share your progress, feel free to explore forums like r/unixporn on Reddit or the theme groups on Pling.
We hope this guide has been helpful!