Skip to content

Icons and Icon Themes

andrew-bibb edited this page Apr 16, 2022 · 11 revisions

This page describes how to set, define and change icons and images used internally to the program. If you wish to know how to change the Application icon (window bar and desktop files) please refer to this page.

CMST uses icons from the Awoken theme for default icons. It is also possible to use icons from an installed icon theme instead. Even if there is no icon theme manager installed on your computer it is still possible to specify an icon theme. The theme you specify will be used provided it is present on your system.

Colorizing Internal Icons

The icons contained in the Awoken icon set are meant to be colorized. The base icons are typically grayscale with a select few already colored. Left as gray they can be hard to see against certain backgrounds. In the preferences tab there is a line edit box to allow you to enter a color value (#RRGGBB) to colorize the icons.

Immediately to the right of the line edit box is a control button (with up triangle) which will open up a standard color selection dialog. Using the "Pick Screen Color" button in the dialog you may select any pixel currently displayed on your desktop, you are not limited to picking colors just in the dialog. This makes it easy to select a color prominent in your desktop wallpaper to make CMST fit in better with your desktop.

It is possible to individually override the selected color using the icon definition file (see below). To do that supply a color number in the format RRGGBB as the value on the colorize = line for that icon. By way of example in the default file the color for the "Whats This" button is overwritten to be a shade of blue.

Select an Icon Theme

To select an icon theme you may either supply the -i (--icon-theme) option on the command line, or place a check the Icon Theme check box in the Preferences tab. If you have an icon theme manager on your system and you have used it to define a system wide icon theme that is all you need to do.

If you don't have an icon theme manager or for some reason you don't want to use your system wide theme icons in this program then you need to supply a theme name after the option in the command line, or in the text box in the Preferences tab. As an example, if you wish to use the Adwaita theme you would start CMST this way:

cmst -i Adwaita  

Note 1: Theme names are case sensitive, and Adwaita requires a capital A.

Note 2: Icon themes other than the official built in Awoken one may not display completely correct.

SVG (Only) Based Themes

Certain themes only ship icons in the SVG format, for instance the Breeze icon theme. By default processing of SVG format files is not supported in CMST. The reason being is that it requires an additional QT package and we are trying to minimize the external dependencies of the program.

If you wish to use an SVG based icon set you will need to add SVG support to QT. The package for Arch Linux is qt5-svg. Names for other distributions may vary. All you need to do to process SVG icons is install the package. Everything else will be handled internally by QT.

Icons Not Part Of The Freedesktop.org Icon Name Specification

QT provides very good theme icon selection with an integral fallback mechanism. In order to use the icon selection one must know the name of the icon you want in the theme. This is not a problem with the official named icons, but is if you want to use non-standard icons which likely have different names from theme to theme. A good example for this program are WiFi signal strength icons which exist in most themes, but which are not part of the Freedesktop.org specification.

To work around this we provide an icon definition file located in the user's home directory. This file is meant to be edited and by doing so you may change any icon displayed in the program. The file is heavily commented describing the layout and what each entry means.

The icon definition file ships with definitions for the Awoken and oxygen themes plus derivatives of each. If you are using a theme and the icon you want has a different name simply add it to the list (comma separated) for the theme icons in the icon definition file. Alternatively you can have multiple theme_names = lines in the file and if well commented this can make human reading of the file easier. The icon definition file is located at:

~/.config/cmst/cmst.icon

If this file becomes corrupted by editing or by other means is can be regenerated simply by deleting it, then stopping and starting CMST.

Icon Selection

Icon selections at runtime are as follows: If the -i (--icon-theme) command line switch or preferences setting is not used then the resource name (hard coded Awoken icon) specified in the cmst.icon file will be used if it can be found. If it cannot be found the icon actually hard coded in will be used. This means that the user can specify a different resource in their own file, and if the resource exists it will be used.

If the -i (--icon-theme) command line switch or the preferences settings are used then icons are searched in the following order until one is found:

  1. Freedesktop.org name.

  2. Theme name.

  3. Resource location as specified in the cmst.icon file.

  4. Hard coded internal (Awoken) icon.

It is not required that all entries shown above be present for each icon. For instance we do not supply theme names for icons that have a Freedesktop.org name. There is nothing stopping you from doing so, but as shipped we have structured the file to prefer the official Freedesktop.org name over a theme name.