Icons

The freedesktop project provides the Icon Theme Specification, which applies to most linux desktop environments and tries to unify the look of a whole bunch of icons in an icon-theme. Freedesktop also provides the Icon Naming Specification, which defines a standard naming scheme for icons believed to be installed on any system. The default theme hicolor should include them all.

Installation

Icons and emblems

To append a custom icon to an existing icon theme xdg-icon-resource can be used. This will resize and copy the icon to $HOME/.local/share/icons/. With this method, custom emblems can also be added. Examples:

$ xdg-icon-resource install --size 128 --context emblems archuser-example.png # add as emblem
$ xdg-icon-resource install --size 128 archuser-example.png # add as normal icon

Mime type icons

File managers do not rely on the traditional mime type which file --mime outputs. Instead definitions from /usr/share/mime/ are used. Calling an icon according to the definition found there and copying it to ~/.local/share/icons/ will cause the file manager to display the custom mime type icon. This command illustrates the method to create a custom icon for the keepass database files (.kdb):

$ sed -En 's/(.*)\/(.*)\:.*.kdb.*/\1-\2/p' /usr/share/mime/globs
application-x-keepass2

Rename your icon according to this output:

$ xdg-icon-resource install --size 128 --context mimetypes application-x-keepass2.png

Icon themes

Tip: It is recommended to install the hicolor-icon-theme package as many programs will deposit their icons in /usr/share/icons/hicolor/ and most other icon themes will inherit icons from the Hicolor icon theme.

From a package

Manually

If you cannot find a package for the icon theme you are looking for, you will need to install it manually.

  • Firstly, find and download your desired icon pack. Many different icon themes can be downloaded from the following sites: Opendesktop.org and Xfce-look.org.
  • Then navigate to the directory which contains the icon pack and extract it. Example .
  • Move the extracted folder containing the icons.
    • (system-wide), or:
    • or ~/.local/share/icons/ (user only).
  • Optionally run on the directory that you chose to update the icon cache.
  • Select the icon theme using the appropriate configuration tool for your desktop environment or window manager.
Tip:
  • To update the icon theme, one may instead clone the repository into a different location (e.g. ~/Downloads/) by using git clone theme_repository.git. Afterwards, create a symbolic to that cloned folder in one of the paths mentioned earlier, depending on whether you want this icon theme to be available system-wide or only for the current user. That can be done by running ln -sf theme_path chosen_directory. Then, you may occasionally run git pull in the directory of the cloned repository to update the theme or to check for updates. This way, the updates will be applied easily without you having to download, extract and move themes.
  • Alternatively, create a package yourself, drawing inspiration from the PKGBUILDs of the packages linked at #From a package is also possible. See also VCS package guidelines.

fstab / gvfs

According to this document file managers using GVFS (like GNOME Files or Thunar) can display icons for custom locations, like NFS shares. All you need are some extended mount options inside /etc/fstab with icon names supported by your selected icon theme:

gollark: Why would you need a license to *listen* to things?
gollark: > A Windows (Windows 7+) or Mac (Mac OS 10.8+) desktop or laptop with either 2GB or 4GB of RAM (no tablets, smartphones or Linux)Wow, bee their exam software requirements?
gollark: Does that exist in the UK?
gollark: (also, all the clubs are quite far away)
gollark: I sort of vaguely wanted to do amateur radio stuff, but then COVID-19 existed and all is bees.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.