Chapter 3. Colors

3.1. Introduction

This chapter explains how to configure colors for on-screen elements, including: setting high-contrast color schemes in graphical environments, adjusting screen colors based on the ambient environment, and selecting colors for configuration ports menus.

3.2. High Contrast Theme

Graphical Environments allow you to easily install and set up graphical themes. This paragraph describes how to configure high contrast themes for windows.

3.2.1. XFCE

  • Adwaita-Dusk.tar.bz2

  • Adwaita-Desert.tar.bz2

  • Adwaita-Aquatic.tar.bz2

  • Adwaita-NightSky.tar.bz2

The example is for NightSky, but of course you can choose whichever theme you prefer.

% tar xzvf Adwaita-NightSky.tar.bz2 (1)
% mkdir ~/.themes (2)
% cp -a Adwaita-NightSky ~/.themes/ (3)
% rm Adwaita-NightSky.tar.bz2 (4)
% xfconf-query -c xfwm4 -p /general/theme -s 'Adwaita-NightSky' (5)
% xfconf-query -c xsettings -p /Net/ThemeName -s 'Adwaita-NightSky' (6)
1Extract the downloaded theme archive.
2Create the ~/.themes directory if it does not already exist.
3Copy the extracted themes into ~/.themes.
4Optionally, delete the original compressed file to save space.
5Apply the Adwaita-NightSky theme for the XFCE desktop environment.
6Apply the Adwaita-NightSky theme for GTK applications.

The theme selection steps (5 and 6) can also be performed using the graphical configuration dialogs in XFCE:

% xfwm4-settings
% xfce4-appearance-settings

3.3. High Contrast Icons

Graphical Environments allow you to easily install and set up icon themes. This paragraph describes how to configure high contrast icons.

3.3.1. XFCE

Run the following commands to use the Treepata - High Contrast icons theme with XFCE.

Download Treepata.zip from Treepata - High contrast. Then execute:

# pkg search zip (1)
% unzip Treepata.zip (2)
% mkdir ~/.icons (3)
% cp -a Treepata ~/.icons/ (4)
% rm Treepata.zip (5)
% xfconf-query -c xsettings -p /Net/IconThemeName -s Treepata (6)
1Install the package archivers/zip:
2Extract the downloaded archive file.
3Create the ~/.icons directory if it does not already exist.
4Copy the extracted theme into ~/.icons.
5Optionally, delete the downloaded archive file to free up space.
6Set the Treepata icon theme.

The icon theme (step 6 above) can also be set graphically via the Appearance dialog under the Icons tab. To do so, open the dialog and select your preferred icon theme:

% xfce4-appearance-settings

If you have icon theme problems, install misc/hicolor-icon-theme and graphics/gtk-update-icon-cache:

# pkg install hicolor-icon-theme gtk-update-icon-cache

Run gtk-update-icon-cache(1) to create or update the icon cache:

% gtk-update-icon-cache -f -t ~/.icons/treepata

3.4. Color temperature

This paragraph explains various utilities that adjust screen colors based on temperature, day/night cycles, and gamma settings. These utilities enable both interactive color adjustments and automatic changes based on the local time and geographical location. Some utilities are compatible with the X Window System, others support Wayland, and some work on both display servers.

Table 1. Color Temperature Utilities
NameAuto UpdateEnvironmentPackage

darkman

Yes

X11

accessibility/darkman

gammastep

Yes

X11

accessibility/gammastep

redshift

Yes

X11, Wayland

accessibility/redshift

sct

No

X11

accessibility/sct

sctd

Yes

X11

accessibility/sctd

wlsunset

Yes

Wayland

accessibility/wlsunset

The rest of this section details the steps to install, configure, and launch the utilities.

3.4.1. darkman

darkman(1) is a daemon that automatically manages transitions between dark mode and light mode. It operates primarily in the background, switching the screen’s color scheme based on the local time of the current location. To install, run:

# pkg install darkman

Create the file ~/.config/darkman/config.yaml and write your latitude and longitude. Example:

lat: 37.52
lng: 122.16

The utility does not directly change the screen colors; instead, it calls external utilities to perform the color transitions. Add scripts to be executed at sundown by placing them in $XDG_DATA_DIRS/dark-mode.d/ and scripts to be executed at sunrise by placing them in XDG_DATA_DIRS/light-mode.d/. Several example scripts are available in the project repository.

To start darkman manually, run:

% darkman run &

The utility also offers some interactive options; for more details refer to the darkman(1) manual page.

3.4.2. gammastep

The gammastep(1) utility adjusts your screen’s color temperature automatically based on your location. To install, run:

# pkg install gammastep

The utility works out of the box without any configuration. Simply start it by running:

% gammastep &

If you encounter any issues, customize the configuration by adapting the gammastep.conf.sample file and save it as ~/.config/gammastep/conf.ini. Refer to the README for troubleshooting.

3.4.3. redshift

The redshift(1) utility find your position and sets the color temperature accordingly. To install, execute:

# pkg install redshift

The redshift utility runs without any configuration. To start it, simply execute:

% redshift &

The utility might hang while trying to determine the location or the correct method to set the color. In this case, specify them explicitly using -l latitude:longitude and -m method. The available methods can be listed by running: % redshift -m list.

Example of running redshift with an explicit location and method:

% redshift -l 37.86:-122.27 -m randr &

To make this setting permanent, add the following lines to ~/.config/redshift/redshift.conf file:

[redshift]
adjustment-method=randr
location-provider=manual

[manual]
lat=37.86
lon=-122.27

The project provides a default redshift.conf.sample configuration file. For troubleshooting and additional information, please refer to the README.

3.4.4. sct

The sct(1) utility is a simple command-line tool for controlling screen color temperature. It does not update automatically and must be run repeatedly to adjust the temperature over time. To install, execute:

# pkg install sct

The utility takes temperature values between 1000 and 10000, 6500 is the default. To run sct, type: sct value:

% sct 8000

The utility suggests 3 styles:

1) Campfire style

% sct 4500

2) Dust storm on Mars style

% sct 2000

3) Coffee free all nighter style

% sct 8000

3.4.5. sctd

The sctd utility calculates sunrise and sunset times based on latitude and longitude, and adjusts the screen’s color temperature accordingly. To install, run:

# pkg install sctd

To run sctd, specify your location using the --latitude and --longitude options:

% sctd --latitude 40.55 --longitude 14.34 &

To reset the screen color to default, run:

% sctd --reset

3.4.6. wlsunset

The wlsunset(1) utility is a Day/Night gamma adjustments for Wayland compositors.

To install, execute:

# pkg install wlsunset

To start the utility type wlsunset -l latitude -L longitude. Example:

% wlsunset -l 14.34 -L 40.55 &

3.5. Ports Collection

FreeBSD provides the Ports Collection, which offers a simple way to install applications. Some ports allow you to configure options before building and installation. By default, configuration is handled through a TUI menu built by the ports-mgmt/portconfig. The colors can be customized in several ways:

  1. Terminal color capabilities.

  2. The $NO_COLOR environment variable.

  3. he $PORTCONFIG_THEMEFILE environment variable.

  4. The global /usr/local/etc/portconfig/theme.conf file.

These methods are listed in order of priority and are mutually exclusive.

1. Terminal Colors

portconfig(1) automatically detects whether the terminal supports colors. If not, it defaults to a black-and-white theme.

2. NO_COLOR

If the $NO_COLOR environment variable is set and not empty, portconfig forces the black-and-white theme

Example 1. Example persistent setting $NO_COLOR

/etc/make.conf

export NO_COLOR=YES

3. PORTCONFIG_THEMEFILE

If the $PORTCONFIG_THEMEFILE environment variable is set and points to a valid theme file, it will be used. Otherwise, the default theme is applied.

Example 2. .Example persistent setting $PORTCONFIG_THEMEFILE

/etc/make.conf

export PORTCONFIG_THEMEFILE=/home/foo/mytheme.conf

To create a new theme file, run:

% /usr/local/bin/bsddialog --save-theme mytheme.conf --infobox "Saving theme..." 0 0

4. Global theme.conf

If the file /usr/local/etc/portconfig/theme.conf exists and is valid, it will be used. If not, the default theme is applied.

Sample themes are included in /usr/local/etc/portconfig/:

  • blackwhite.conf

  • yellow-blue.conf

  • red-green.conf

  • yellow-blue.conf

To use the yellow-blue.conf theme:

# ln -s /usr/local/etc/portconfig/yellow-blue.conf /usr/local/etc/portconfig/theme.conf

Last modified on: June 16, 2025 by Alfonso Siciliano