Skip to content

Getting Started

Federico edited this page May 7, 2019 · 34 revisions

Clight is a C user daemon utility that aims to fully manage your display.
It will automagically change screen backlight level for all monitors, even external ones, to match ambient brightness, as computed by capturing frames from webcam or from an ALS device.
It can adjust your keyboard backlight too.
Moreover, it can manage your screen temperature, just like redshift does.
Finally, it can dim your screen after a timeout, and manage DPMS timeouts.

Name origin

Name Clight was inspired by some different sources.
First of all it obviously stands for C Light.
It also contains a small pun as in "See Light".
Finally, "C Light" where "C" points to its programming language, and "Light" being both its main topic and its strive to be very lightweight.

Main Features

Please refer to clight conf file for more informations about each feature!

  • Very lightweight
  • Lots of configurations available
  • It supports per-user conf file placed $XDG_CONFIG_HOME/clight.conf (fallbacks to $HOME/.config/), and a global one (/etc/default/clight.conf)
  • Provides a desktop files to quickly take a screen calibration; moreover it provides 2 additional actions: "inhibit dimmer" and "resume dimmer", useful where org.freedesktop.PowerManagement.Inhibit API is not supported
  • GAMMA support: it will compute sunset and sunrise and will automatically change screen temperature (just like redshift does) -> X only
  • DIMMER support: it will dim your screen after specified timeout of user inactivity (ie: no mouse/keyboard interactions) -> X only
  • DPMS support: it will set desired dpms timeouts for AC/batt states. -> X only
  • Both DPMS and DIMMER can be disabled while on AC, just setting dimmer timeout/any dpms timeout for given AC state <= 0.
  • geoclue2 support: when launched without [--lat|--lon] parameters, if geoclue2 is available, it will use it to get user location updates. Otherwise gamma support will be disabled. Location received will be then cached when clight exit. This way, if no internet connection is present (thus geoclue2 cannot give us any location) at restart, clight will load latest available location from cache file. If no cached location is present, gamma will be disabled.
  • --sunrise/--sunset times user-specified support: gamma nightly temp will be setted at sunset time, daily temp at sunrise time.
  • Nice and clean log file, placed in $HOME/.clight.log
  • More frequent captures inside "events": an event starts by default 30mins before sunrise/sunset and ends 30mins after. It is obviously configurable.
  • UPower support, to set longer timeouts between captures while on battery, in order to save some energy.
  • You can specify curve points to be used to match ambient brightness to screen backlight from config file. For more info, see Polynomial fit section below.
  • Clight supports org.freedesktop.PowerManagement.Inhibit interface. Thus, when for example watching a youtube video from chromium, dimmer module won't dim your screen.
  • Supports both internal laptop monitor and external monitors (thus desktop PCs too), thanks to ddcutil.
  • Supports keyboard backlight calibration through UPower
  • It detects whenever an USB webcam is attached/detached and resumes/pauses backlight module.
  • Smooth gamma/dimmer/backlight transitions (can be disabled)
  • User can disable autocalibration (BACKLIGHT and GAMMA). This is useful in case you wish to leave your webcam covered all the time except when you manually trigger a calibration
  • It ships a nice dbus interface
  • It supports a custom conf file to be parsed in addition to global and user ones. This is useful when eg: starting clight with a script that uses different configurations for weekdays and weekends.
  • It supports very long gamma transitioning, similar to redshift or win10 ones.
  • It supports ambient-brightness-based gamma; it means that screen temperature will be updated to match ambient brightness instead of sunrise/sunset based, using same curve specified for backlight.
  • It ships an autocompletion script for bash

Will it eat my battery?

No, it won't. Clight aims to be very power friendly. In fact, thanks to I/O multiplexing, it uses CPU only when needed.
Moreover, being very lightweight on resources helps too. Indeed, it will probably help you saving some battery, by setting correct screen backlight for current ambient brightness (thus avoiding wasting battery on max backlight level).
Finally, remember that webcam is not always on; it is used only when needed with timeouts between clusters of captures thoroughly thought and configurable (with longer timeouts while on battery).

Clone this wiki locally