Skip to content
Federico Di Pierro edited this page Jun 9, 2023 · 8 revisions

Config file

A global config file is shipped with clight. Before Clight 4.10, it was installed under /etc/default/clight.conf.
Now it is installed in /etc/clight/clight.conf and it includes each module config from /etc/clight/modules.conf.d/ folder.
Old config file location is still supported to retain backward compatibility, but its support will be dropped in the near future.

You can customize it or you can copy it in your $XDG_CONFIG_HOME folder (fallbacks to $HOME/.config/) and customize it there.
Both global and user configs are checked when Clight starts, in this order: old-global -> global -> user-local -> cmdline opts.

Custom config file

Moreover, since Clight 3.2, you can specify your own config file from cmdline, effectively overriding settings from other conf files.
This means that new config chain will become: global -> user-local -> cmdline opts -> custom conf.
Your custom conf will only override conf options it contains.
It is useful when eg: starting clight from an user cron job, that would set sunrise and sunset to eg: 7:30/18 times during work days, and different ones during weekends.

CmdLine options

For cmdline options, check clight [-?|--help] [--usage].
Note that a bash autocompletion script is installed together with clight.

Polynomial fit

Clight makes use of Gnu Scientific Library to compute best-fit around data points as read by clight.conf file.
Default values on AC are [ 0.0, 0.15, 0.29, 0.45, 0.61, 0.74, 0.81, 0.88, 0.93, 0.97, 1.0 ]; indexes (from 0 to 10 included) are our X axys (ambient brightness), while values are Y axys (screen backlight).
For example, with default values, at 0.5 ambient brightness (6th value in this array) clight will set a 74% of max backlight level.
By customizing these values, you can adapt screen backlight curve to suit your needs. Note that values must be between 0.0 and 1.0 obviously.
Clight supports different curves on different ac states. In fact, by default on BATT points are different from above. See config file for more info.
Since Clight 4.0, you can even specify up to 50 points for linear regression; this is useful for much more granular control.

Gamma support info

As clightd getgamma function properly supports only 50-steps temperature values (ie if you use "setgamma 6000" and then getgamma, it will return 6000. If you use setgamma 4578, getgamma won't return exactly it; it will return 4566 or something similar.), do not set in your conf not-50-multiple temperatures.

Clone this wiki locally