Skip to content

Getting Started

Federico Di Pierro edited this page Oct 23, 2021 · 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 (Ambient Light Sensor) 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.

For a quick overview, you can run man clight to see Clight's man pages.

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.

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).

Main Features

Please refer to clight conf file for a more comprehensive list, together with more informations about each feature!

  • Very lightweight
  • Lots of configurations available
  • Per-user conf file support, placed $XDG_CONFIG_HOME/clight.conf (fallbacks to $HOME/.config/)
  • Granular configurations: for example, you can set different timeouts for AC or BATTERY states
  • Provides a desktop files to quickly take a screen calibration and with most commonly needed additional actions
  • Smart detection: modules will only be started when needed (eg: UPower is not started on desktop PCs)
  • Webcam and ALS sensors support for ambient brightess capturing (see https://github.com/FedeDP/Clightd/wiki/Sensors)
  • Detects whenever a sensor is attached/detached and consequently resumes/pauses backlight module
  • External monitors support, thanks to ddcutil
  • External monitor hotplug support, again thanks to ddcutil
  • Keyboard Backlight calibration support
  • GAMMA support: it will compute sunset and sunrise and will automatically change screen temperature (just like redshift does)
  • 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.
  • DIMMER support: it will dim your screen after specified timeout of user inactivity (ie: no mouse/keyboard interactions)
  • DPMS support: it will switch off your screen after desired timeout has elapsed
  • A very simple SCREEN-emitted light compensation support
  • Smooth GAMMA/DIMMER/BACKLIGHT transitions
  • 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.
  • UPower support, to set longer timeouts between captures while on battery, in order to save some energy.
  • Docked state support, for laptops: when laptop lid is closed, "Docked" state is checked. It can manage a "Docked" state as an inhibtion for DIMMER and DPMS
  • org.freedesktop.ScreenSaver interface support. Thus, when for example watching a youtube video from chromium, DIMMER and DPMS will be inibited.
  • Nice dbus interface
  • Ships an autocompletion script for bash
  • It supports custom modules, runtime loaded
  • Man page: man clight
Clone this wiki locally