Clight It is a tool that uses the computer’s webcam or ambient light sensor to obtain the ambient brightness, and then calculates and sets the screen backlight accordingly.
In addition to adjusting the screen backlight according to the ambient brightness, the program can also adjust the keyboard backlight and manage the screen temperature according to the sunset and sunrise time (GAMMA support), similar to Redshit. Also supports external displays. After a period of inactivity, it can also dim the screen and manage the screen DPMS.
The tool can run on X11, Wayland and tty, although it can also be used on Wayland protocol It needs to be implemented by your synthesizer to work properly.
Clight itself is a daemon (written in C), so it does not have a graphical user interface, but it is cool Third-party Qt 5/6 GUI Yes, it allows configuring Clight and includes a tray applet:
It is important to note that Clight is lightweight and its goal is to be very energy efficient, using the CPU only when needed. Therefore, it should not drain the laptop battery. It does not use the camera all the time, but only when needed, and has a longer battery life.
- Per user profile support
- Detect when the USB webcam is connected/disconnected, so as to resume/suspend the backlight module
- GAMMA based on ambient brightness; this means that the screen temperature will be updated to match the ambient brightness using the same curve specified for the backlight, not based on sunrise/sunset (this is a function that can automatically change the screen temperature based on sunset and sunrise times)
- You can use geoclue2 (used to get the user’s location) to automatically get the sunset/sunrise time, or the user can manually specify the sunset/sunrise time
- Simple SCREEN glow compensation function
- Smooth GAMMA / DIMMER / BACKLIGHT transition
- UPower support, you can set the timeout between two shots when using battery power to save energy
- The docking status of the portable computer is supported: When the lid of the portable computer is closed, the “docking” status will be checked. It can manage the “docking” state to suppress DIMMER and DPMS
- org.freedesktop.ScreenSaver interface support.So, for example, when watching YouTube videos from Chromium, DIMMER and DPMS will be banned
- Dbus interface that can be used to create scripts E.g, Bash auto-completion script, Custom module, Many available configuration options, etc.
Related: Gammy: Adaptive Screen Brightness Tool for Linux
Install Clight (and optional Clight-GUI)
The only disadvantage of Clight?You not only need to build Clight with sleepy From the source, but there are also 2 dependencies (lib module with ddcutil),as well as Clight GUI If you want to use it. That is, unless you use Arch Linux / Manjaro ( AUR package Available), NixOS, Exherbo or Void Linux (Yes) Available packages.
Please note that for Debian/Ubuntu/Linux Mint/Pop! _OS, in addition to the commands used to install dependencies from Clight Wiki, you also need the following packages to build Clight, Clightd and its 2 dependencies (libmodule and ddcutil):
libdbus1-dev libudev-dev libjpeg-turbo8-dev libpolkit-gobject-1-dev libdrm-dev libglib2.0-dev libusb-1.0-0-dev libtool autoconf autotools-dev libx11-dev libxrandr-dev libxext-dev libwayland-dev.
You also need to make sure you have
git Installed to pull the repository from GitHub. You can also install (optional)
libgeoclue-2-dev Obtain user location automatically to get sunset/sunshine time.
Once all these packages are installed, Use this script To build and install Clight, Clightd, ddcutils and libmodule.
For Clight-GUI, you also need to install
libqt5charts5-dev On Debian/Ubuntu. Also, on my Ubuntu 20.04 desktop, Clight-GUI failed to build (it is not on Ubuntu 20.10) and displayed an error message “DBusSingle.h: 20 error: not a signal or slot statement”.I solved this problem by opening
clight-gui/src/dbus/DBusSingle.h, And then in line 19, I deleted “slots” (so now it’s just “public:”).
It is also worth noting that to be able to view Clight-GUI on GNOME Shell, you need an extension, such as AppIndicator and KStatusNotifierItem support (This is installed on Ubuntu by default, so you don’t need to install anything).
Clight-GUI uses a dark tray icon by default, so depending on the color of the panel, you may not see it at all-solve this problem by setting Clight-GUI to use the light tray icon in its tray menu (” Light tray icon” option).
In addition, some of the latest geoclue2 versions will cause the Clight startup time to increase by up to 20 seconds.
Related: When the GNOME night light is on, change the Shell/GTK theme to the dark variant