Color Schemes in Terminology
Terminology uses color schemes to define the usual colors used by terminal applications, and a bit more: color schemes can also have an impact on the theme used.
The colorschemes are stored in EET format for speed up and ease of development. This format being a bit cumbersome to edit, color schemes can be edit in an easy INI format described below.
One can have a look at
data/color_schemes/Default.ini for an example.
Organisation of the file
The INI format is made of sections, where the name appears in square brackets
]), that contain keys. Every key has a name and a value, delimited
by an equals sign (
Those value have 3 types:
- integers, mostly used to describe versions,
- strings, surrounded by double quotes (
") or not,
- colors, described as hex color codes, with or without alpha channels, like
;) at the beginning of the line indicate a comment.
The color scheme file contains the following sections that are mandatory:
This section has only one field
version with a default of
In case the format has to change, this value will change.
This describes everything that is related to the color scheme but is not actually a color! The fields are the following:
version: an integer, this is the version of the color scheme itself
nameis the name of the color scheme. It is expected to be the same as the file name without the
author: who made this color scheme
license: the short code of an opensource-approved license as listed on https://spdx.org/licenses/
This section describes colors used in the UI. The fields are:
bg: the background color of the terminal
main: this color is used as the main color for cursor and various effects on the terminal, like change of border on focus …
hl: a color used for an object or text when being highlighted. Usually surrounded by the
end_sel: on selections, the color of the handles used to expand or shrink the area of the selection
tab_missed_3: the main color, the outline color and the shadow color of the number of tabs where a bell has rung, tabs that need attention.
tab_missed_over_3: same as before but when the mouse is over that number
tab_title_2: the outline color of the active tab title. The foreground used is
Normal.defand the shadow is
All those sections offer the same set of colors.
Normal are the base colors.
Bright are a brighter version of the
Faint are a dimer version of the
Normal colors. Finally,
BrightFaint are a dimer version of the
They all have those fields:
def: the default foreground color
inverse_fgare the colors used when espace codes are used to reverse background and foreground. Sometimes used to display selections by the terminal applications
How to add a new color scheme
First, one has to write a color scheme file as described above. Let's say we
are creating the color scheme
FooBar stored in file
BrightFaint version can be generated by using the
gen_faint.py script stored in
data/color_schemes/ as seen below:
What this script does is to pick the colors from
merge them with the background color (
Colors.bg) in a 70/30 proportion. This
proportion is configurable, like this for a 80/20 proportion:
gen_faint.py FooBar.ini 80
Now that we are happy with the content of
FooBar.ini, we can call
add_color_scheme.sh stored in
data/color_schemes/ as seen
add_color_scheme.sh eet ~/.config/terminology/colorschemes/FooBar.eet FooBar.ini
Now you should be able to select your color scheme in Terminology!