In Linux, icons are graphics used to visually represent applications, files, and various system elements on the Desktop and in the file manager. Sometimes, we might want to check where the icons are located to adjust icon settings and enhance user experience.
In this tutorial, we’ll explore different icon types and their locations in Linux. In addition, we’ll also learn how to change the icon theme from the terminal.
First, we’ll begin by exploring the types of icons available in a GNOME desktop environment. Following that, we’ll discuss the locations of those icons. Lastly, we’ll see how to change the icons on a Linux machine.
2. Types of Icons
There are three main types of icons in a GNOME environment:
- system icons, such as icons for system settings, network connections, battery, and similar
- application icons for installed applications
- icons for files and directories
System icons are typically used in the system tray or notification area. On the other hand, application icons are found in the application launcher, system menu, or on the Desktop.
As for the files and directory icons, these usually appear in the file manager, and their appearance depends on the theme installed on a system.
3. Locating System Icons
Various applications often use system icons stored in the /usr/share/icons/ directory.
In fact, inside this directory, we can find subdirectories corresponding to different icon themes. In addition, within each theme directory, there are directories for different icon sizes and types.
Now, let’s examine the top-level view of our system icons directory via the ls command:
$ ls /usr/share/icons/
Adwaita handhelds redglass Yaru-blue Yaru-prussiangreen Yaru-sage-dark
default hicolor ubuntu-mono-dark Yaru-blue-dark Yaru-prussiangreen-dark Yaru-viridian
DMZ-Black HighContrast ubuntu-mono-light Yaru-dark Yaru-purple Yaru-viridian-dark
From the output, we can see that there are directories related to themes along with some icon files. The latter are most often in the .svg format.
Since GNOME-based distros often use the Adwaita icon theme, let’s check what’s inside this directory:
$ ls /usr/share/icons/Adwita
16x16 24x24 32x32 512x512 8x8 cursor.theme index.theme scalable-up-to-32
Here, we can see various resolutions which refer to the icon resolutions.
Next, let’s explore one of the subdirectories within:
$ ls /usr/share/icons/Adwita/16x16/ui
pan-down-symbolic.symbolic.png pan-up-symbolic.symbolic.png window-minimize-symbolic.symbolic.png
The above output displays a list of system-wide icons, stored in the .png format.
4. Locating Application Icons
Application icons are associated with each application installed on the system.
Moreover, to find where application icons are stored, we can view the directory at /usr/share/applications:
$ ls /usr/share/applications/
apport-gtk.desktop gnome-power-panel.desktop openjdk-8-java.desktop
apturl.desktop gnome-printers-panel.desktop openjdk-8-policytool.desktop
From the above output, we can see that each application usually has a .desktop file. Subsequently, that file contains information about the application, including the path to its icon. In fact, this is valid for Desktop entry files in general.
$ cat /usr/share/applications/firefox.desktop | grep Icon
First, the command shows the content of the firefox.desktop file located in the /usr/share/applications/ directory. Subsequently, it employs the grep command to filter for and selectively show only lines that contain Icon.
Hence, this process enables the extraction of information pertaining to the icon associated with the Firefox application specified in the mentioned file.
5. Locating User-Specific Icons
The icons for user-specific settings and applications reside in the ~/.icons/ or ~/.local/share/icons/ directory. This is where user-specific customizations, including manually installed icon themes, are located.
Let’s look at this icons directory:
$ ls ~/.local/share/icons/
Notably, we’ll only find this directory if we installed a theme manually. Otherwise, this directory doesn’t exist. In other words, if a user installs a theme that is specific to that user, and isn’t a default theme, only then the directory will be visible.
6. Changing a Theme Icon
Each theme’s directory structure typically stores the theme icons. The exact path varies depending on the desktop environment and the theme itself. However, the user-specific icons are often located in the ~/.themes/ directory.
In addition, if a user has downloaded an icon theme, then it might be available in the ~/.icons/ or ~/.local/share/icons/ directories.
To change a theme from the terminal, we use the gsettings command. For instance, to change the system theme, we set the gtk-theme key of the org.gnome.desktop.interfaces path:
$ gsettings set org.gnome.desktop.interface gtk-theme 'Humanity-Dark'
Now, this changes the desktop theme in a GNOME system to Humanity-Dark.
Similarly, for the icon theme, we use the icon-theme key:
$ gsettings set org.gnome.desktop.interface icon-theme 'Humanity-Dark'
Alternatively, we can change the icon themes via other means.
In this article, we learned how to find where the icons are stored on a Linux system, as well as a way to change them globally.
Initially, we explored the types of icons available in a GNOME desktop environment. After that, we discussed the locations of those icons. Lastly, we saw how to change the icons on a Linux machine.