Skip to content

Releases: FedeDP/Clight

v4.1

26 Jul 16:25
Compare
Choose a tag to compare

Welcome to Clight 4.1!

In this release, main focus was around fixing some 4.0 bugs while improving user experience with lots of goodies.
First of all, conf file was fully rewritten with a much more logical partitioning.
Following this work, both INTERFACE and logfile were logically improved too!

Moreover, some new modules were born: PM, DAYTIME and WIZARD.
PM manages PowerManagement inhibition (user-settable);
DAYTIME allows clight to manage daytime informations even with disabled GAMMA;
WIZARD has only effect in --wizard mode; it is a super simple calibration wizard that helps users to correctly set backlight curve.

Finally, a huge internal modules architecture change took place; thanks to that, any module' state change is published, even initial ones. This is mostly useful for custom modules.

Let's see in details:

Features

New Conf file layout

  • Use libconfig "groups" instead of new conf files
  • Split sensor-related settings from conf_t
  • Move number of captures to sensor specific settings
  • Update log_conf

Interface

  • INTERFACE follows config rework by exposing Conf/Backlight, conf/Gamma...
  • Expose 2 new methods from dbus api: Increment/Decrement
  • Expose SensAvailable state property
  • Renamed "Calibrate" method to "Capture"
  • Capture method to take 2 booleans, exposing capture_upd fields
  • Added a force option to inhibit_upd msg requests, to forcefully remove any inhibiton; it is used internally by clight Inhibit "false" dbus interface,
  • Expose PMInhibited property on bus
  • Expose LidClosed property through dbus interface

Backlight

  • Allow to pause backlight calibration on battery by setting timeout <= 0
  • Allow users to use different number of captures for each AC state
  • Added support for new Clightd API that only returns number of successfully retrieved captures
  • Hook Backlight.Changed Clightd signal to update state.current_bl. The signal is emitted by clightd 4.2 for laptop's internal monitors. No chance to implement that for external monitors through DDCutil
  • Dropped inhibit_autocalib (to be demanded to inhibit_bl custom module)

Keyboard

  • Split KEYBOARD (module and settings) from BACKLIGHT
  • Allow to switch off keyboard backlight above certain ambient brightness threshold
  • Allow to switch off keyboard backlight on dpms/dimmer

Inhibit

  • Only start INHIBIT if DIMMER or DPMS are enabled
  • Do not create/listen on ScreenSaver dbus interface requests if inhibit module is not started
  • Added support for multiple inhibition sources

PM

  • Allow to suppress org.freedesktop.PowerManagement on inhibition
  • PM is only available if INHIBIT is started
  • PM inhibition is released when clight leaves

UPower

  • Only start Upower module on laptops -> "LidIsPresent" property
  • Added "Docked" state management
  • Allow to hook Docked signal to be managed as inhibition, pausing dimmer and dpms and eventually backlight autocalib
  • Added "LidClosed" signal
  • Allow to use LidClosed signal to eventually pause calibration
  • Properly manage lid/docked state since clight start (ie: if laptop boots up docked)

Location

  • Restore get_distance() function and use it to validate new location request. It is useful as we may have multiple location sources (eg: cache file and geoclue)
  • Immediately load cache location without 3s timer; this allows for faster clight startup times

Gamma

  • Split DAYTIME module from GAMMA: this way even with disabled GAMMA, clight can still have daytime informations if any location is provided

Wizard

  • Add a very simple first-run calibration wizard, started through clight --wizard
  • Added new -w flag to clight bash completion script

Modules architecture

  • Start all modules together; then let modules wait on proper condition before actually start doing things; This way published messages are received by everyone, even custom modules that are now able to build initial clight state.

Screen

  • Pause SCREEN on lid closed and SENSOR not available too

Bus

  • Drop LIBSYSTEMD < 237 support (and bump CMakeLists required version)

Generic

  • Reworked log_conf() function to print configs MODULE based, just like conf file
  • Actually read sensor_devname reported by clightd Capture call; this way users can check from log which sensor has been used
  • Use DEBUG loglevel instead of WARN in validations. Not that useful in production
  • Avoid using any variable from disabled modules
  • Avoid logging disabled modules conf as it is not checked
  • Avoid creating disabled modules conf interafce
  • Kill clight on bus disconnection (ENOTCONN/ECONNRESET errnos)
  • Drop "Disabled" from dbus INTERFACE as now disabled modules are not exposed
  • Explicit in custom modules DOC which modules are always available and which not
  • Less verbose log (inhibit and pm modules DEBUG)
  • Allow custom module to use public DEBUG macro

Bugfixes

Backlight

  • Properly clamp compensated_brightness between 0 and 1 before setting new backlight
  • Properly set 0.0 backlight level if shutter_threshold is 0.0 (>= instead of >)
  • set_new_backlight should take current ambient_br * conf.num_points (that is no more fixed to 10!)
  • Correctly manage pubsub messages when in paused state

DPMS

  • Make sure to actually restore DISPLAY_ON state from DPMS module if DIMMER is disabled.

Inhibit

  • Fixed "Failed to parse parameters: No such device or address" message

Generic

  • Avoid loging in modules dtor as log has already been closed

Thanks to all users who contributed with their enthusiasm both testing git packages and opening issues, and proposing new features :)
As always, Clight is made for you all; if it would not been for your enthusiasm, it would have never reach such a incredible state!
Thank you users!

v4.0

24 Nov 13:58
Compare
Choose a tag to compare

Clight 4.0

Hi everyone! Here is a new, shiny Clight release!
This is probably the biggest release ever, with lots of commits and behind the scenes changes.
All in all, it has been a really huge work and it took me really lot of time, but i love what Clight is able to offer right now!
This huge work would not have been possible without having fun spending time on Clight;
yet the fun (and consequently my commitment) would be much lower without lots of enthusiasts users!
Let me thank the more active ones (i am sorry if i forgot anyone...)

Code contributors:

  • ErikPitko (fix keyboard backlight setting) PR #94
  • ILMAZ13 (fix in GAMMA conf loading) PR #63
  • mendelmunkis (fix for some comments in conf file) PR #60
  • yochananmarqos (fix to Arch PKGBUILD) PR #57

Non-code contributors, for their support/ideas/suggestions/time spent on debugging:

  • Alkotronikk
  • demoy
  • mindrunner
  • ModDM

Finally, one more mention; he hasn't got a github account and wrote me lots of mails with his great ideas:

  • Jim Todt

Moreover, a full port to libmodule library, already used in Clightd, took place.
This was needed to strengthen and simplify code, and allows much easier development and powerful features.

By the way, let's see this release's highlights!

New Features

DIMMER

  • Different settings for DIMMER leaving-fading transitions (smooth, timeouts and steps)
  • Thanks to Clightd 4.0, DIMMER module does not require Xorg anymore. It works everywhere (tty too!)

GAMMA

  • GAMMA module does now support long_gamma_transition option, to change gamma in a way similar to redshift/Windows (very long transitioning)
  • (#61) GAMMA now can work ambient-brightness-based, thanks to ambient_gamma option. It means it will change screen temperature based upon current ambient brighness level, following BACKLIGHT module.

BACKLIGHT

  • (#95) Clight now supports up to 50 points for backlight curve
  • (#81) Clight automatic calibration can now be inhibited too by INHIBIT module
  • Clight does now support setting webcam capture parameters, thanks to Clightd 4.0

DPMS

  • Following Clightd 4.0 changes, DPMS is now a special case of screen dimming, and it only supports a single dpms level (ie: screen ON/ screen OFF)
  • Consequently, dpms timeouts for various dpms levels were dropped, leaving a single timeout for each ac_state
  • DPMS does now work on tty too (not on wayland though)
  • When screen enters dpms state, BACKLIGHT module will stop capturing ambient brightness/changing backlight level

SCREEN

  • (#84) Following Clightd 4.0 new API, a new SCREEN module was created. It is needed for a (simple but hopefully effective) screen-emitted-brightness compensation
  • It will compute current screen brightness by taking snapshots of your desktop (they are obviously immediately destroyed!)
  • It then will feed a bucket of configurable size, and after bucket is filled, it will start computing average screen-emitted-brightness
  • Screen-emitted-brightness is then multiplied by a configurable factor and will be subtracted from ambient brightness as found by webcam capture
  • It only works on X
  • It is disabled by default on battery

INTERFACE

  • Expose "KbdPct" property
  • Expose "Temp" property
  • (#50) "NoAutoCalib", "NoKbdCalib", "AmbientGamma" are now writable bus properties
  • Expose "Inhibited" property
  • Expose "ScreenComp" property
  • Expose "ClightdVersion" property
  • Expose "Conf.ScreenContrib" property (writable)
  • Expose "Conf.SensorSettings" property (writable)
  • "Sunrise" an "Sunset" are now writable properties

Config

  • A new cmdline option is now available, that let you specify a custom conf file to be parsed (after global and local ones).
    This can be useful to eg: start Clight with 2 different gamma fixed Sunrise/Sunset times for weekdays and during weekend.
  • Reworked Clight conf file, much better organized now

Generic

  • Added "pause calib" and "resume calib" actions to desktop file
  • Add issue template to github
  • Automatically detect Clightd features and disable corresponding clight modules (ie: if Clightd is built with GAMMA disabled, it will be disabled in Clight too)
  • CPack support was added to CMake, to support both RPM and DEB file generation

CUSTOM MODULES

Using libmodule 5.0.0 allows Clight to runtime load user custom modules.
This means users can write their own plugins in C and attach them to Clight.

  • Added a couple of custom modules examples in wiki pages, with highly requested features
  • Supply a clight public header in /usr/include/clight/public.h to be include to write modules
  • Install a module skeleton in /usr/share/clight/module.skel
  • Clight will try to load custom modules from XDG_DATA_HOME/clight/modules.d/ (fallbacks to .local/share/clight/modules.d where XDG_DATA_HOME is not set), and /usr/share/clight/modules.d/
  • XDG_DATA_HOME modules will have higher priority, ie: you can shadow a global custom module with a local one.
  • There cannot be 2 modules with same name
  • Custom modules can log to clight log too!
  • Through custom modules, user can practically call any Clight feature in a very easy way

A related wiki page has been added: https://github.com/FedeDP/Clight/wiki/Custom-Modules.

INHIBIT rewrite

After a nice and long discussion about org.freedesktop.PowerManagement support, i realized that the correct way to handle
inhibition requests was not org.freedesktop.PowerManagement support.
Indeed it is org.freedesktop.ScreenSaver support.
PowerManagement inhibition is sent eg: by your torrent application while a download is active, or by your FM while a copy is ongoing. Thus it is wrong for Clight to support it.
Instead, Clight should implement org.freedesktop.ScreenSaver API letting other applications transparently inhibit it.
This interface is widely supported; eg: chromium will call Inhibit method while watching a youtube video, ONLY while tab is on foreground. This is great!

There is a downside though: if org.freedesktop.ScreenSaver API is already provided by anyone (eg: your DE, that is the case for me on KDE) you are out of luck, as only one program (ie: the first to request the dbus name) can provide the same dbus interface at the same time.
But there is a workaround, already included: monitor requests sent to org.freedesktop.ScreenSaver bus name on bus, the same way as "busctl --user monitor org.freedesktop.ScreenSaver" is implemented.
This way, Clight can still be notified when anyone requests an (un)inhibition.

So, summing it up:

  • Best case: org.freedesktop.ScreenSaver available -> you'll have everything working fine; DIMMER and DPMS will be inhibited in a much better way than now: eg: chromium will only keep is inhibition ON while you're in a tab that is playing video. If you change tab, ScreenSaver inhibition will be dropped.
    Moreover, ScreenSaver inhibition is only enabled for videos.
  • Worst case: org.freedesktop.ScreenSaver API is already owned by another software, eg: your DE powermanager. Clight will fallback at monitoring org.freedesktop.ScreenSaver requests and will react to them as if these requests were actually sent to it.

Consequently, all PowerManagement part was dropped, and ScreenSaver spec is now gracefully implemented.
"no_inhibit" configuration was dropped as it was kind of useless: inhibition does not harm anything and does not use resources; it is only convenient and has no downsides.
A related wiki page has been added: https://github.com/FedeDP/Clight/wiki/ScreenSaver-Specification.

Fixes

Generic

  • (#70) Fixed build when LIBSYSTEMD_VERSION is a float
  • Fixed small conf reading bug
  • Fixed a bug in reset_timer with < 0 old values
  • a PR sent to Geoclue to fix a 20s hang on startup has been created and merged. Geoclue 2.5.4 and later already ship the fix.
  • Fixed internally used bus::call() function to actually work on libsystemd < 234.

BACKLIGHT

  • (#94) Fixed issue with call() variadic argument for keyboard backlight

GAMMA

  • (#78) Fixed a case of wrong daylight calculation (wrong Sunrise/Sunset times)

LOCATION

  • 0.0:0.0 is actually a good location. Avoid using these values to filter away unsetted location
  • Dropped get_distance method, directly using Geoclue2 threshold. "TimeThreshold" was needed too: "When TimeThreshold is zero, it always emits the signal."
  • Only cache location when leaving if any geoclue2 client was initialized

And surely much more fixes and improvements all over the place i am currently forgetting!

Hope you'll enjoy Clight 4.0!

v3.0

02 Dec 09:19
Compare
Choose a tag to compare

I'm very proud to present you Clight 3.0.

First of all, let me warmly thank some contributors for their great support; alphabetic order:

  • @danyspin97 -> Patches towards Elogind support for Clight
  • @Dr-Ongo -> Great support while debugging a weird issue with ddcutil
  • @jghauser -> Great support while debugging a weird issue with ddcutil
  • @rockowitz -> ddcutil developer that actually fixed aforementioned issue
  • @VorpalBlade -> Patches towards Cmake support for Clight

What's new in this release?

Features

Generic

  • Adapted Clight to new Clightd API (3.0 required)
  • Consequently, Clight gained support for ALS devices too
  • Added support for Keyboard backlight calibration (ie: turn it automatically on on low ambient brightness). This needs UPower
  • Backlight module will now gracefully listen on org.clightd.clightd.Sensor.Changed signal: this means that you can start clight with no webcam attached, but as soon as you attach an usb webcam, Backlight will immediately start capturing
  • Ported build system to cmake
  • Ported CI to sr.ht

Desktop file

  • Desktop file has now 2 more options: "Inhibit dimmer" and "Unhinibit dimmer"

New Options

  • Added a NoAutoCalibration mode for clight: it will start with both gamma and backlight "paused", thus you can only use them through bus api
  • Added a shutterthreshold option: you can set it to a double > 0.0 to let Clight consider "shuttered", thus discarding them, captures whose ambient brightness is lower than that value. This is useful if you like to leave your webcam covered.

New Bus Api

Completely redesigned and renewed Bus Api:

  • Expose all timeouts through a "/org/clight/clight/Conf/Timeouts" interface
  • Added bus methods to change backlight interface and video sysname
  • Expose all conf structure through interface in org/clight/clight/Conf
  • Added a "/org/clight/clight/Conf/Store" method that dumps current config to user conf
  • Expose each module state in /org/clight/clight/Modules

Fixes

  • Dropped systemd user service
  • Avoid requiring both --sunrise and --sunset options
  • Avoid leaving clight if --sunrise or --sunset are wrongly setted, start gamma and location instead
  • Dimmer will now set backlight_level to 100% if brightness module is disabled (to start from a well known level)
  • Fixed gamma module for suspended systems

And surely much more I forgot :)
Thanks everyone, enjoy this new release!

v2.5, bus interface

21 Sep 15:39
Compare
Choose a tag to compare

Here is a new Clight release.
Highlights of this release include:

  • Fixed some more geoclue 2 issues
  • Properly install a license file in /usr/share/licenses/clight/
  • Dropped support for xdg autostart, now telling user to properly enable clight.timer systemd unit after installing clight
  • Added clight bus interface (org.clight.clight) to make it easy to create a GUI/applet for clight
  • Clight "single capture mode" is now obsolete and a "Calibrate" method is exposed through clight bus interface
  • Added completion script for bash
  • Dropped some cmdline options, way too cluttered
  • Cleaned up lots of code
  • Fixed lots of small bugs
  • Trimmed readme in favour of github Wiki Pages

v2.4

05 Aug 08:17
Compare
Choose a tag to compare

Some more bugfixes:

  • Properly destroy location module if geoclue could not be inited, even if a cache location is present
  • Properly fixed dimmer module

v2.3

23 Jul 17:09
Compare
Choose a tag to compare

This quick release improves dbus error handling, avoiding leaving clight if any bus error happens.
Every error is now properly propagated and each module should manage it.

This fixes recent issues with geoclue, like this one (reported for redshift, it is the same for clight): jonls/redshift#636: in fact clight caches latest user position before leaving, and uses it on a fresh startup if location module fails to start (ie: geoclue cannot be started).

v2.2, more fixes

20 Jul 17:25
Compare
Choose a tag to compare

Another clight release, another round of fixes!

  • Fixed clight on system with LIBSYSTEMD_VERSION < 234
  • Automatically leave clight if no functional module is running (brightness, gamma, dimmer, dpms)
  • Fixed a couple of dimmer and backlight modules issues
  • Fixed some issues on ubuntu 16.04

Moreover, in this release i dropped deb package support. It was hackish and, as i have less and less time to spend on my side projects, i prefer to avoid wasting any resource on that.

v2.1, bugfixes

19 May 08:08
Compare
Choose a tag to compare

This new Clight release focused on bugfixing and small improvements.

  • Dimmer module is now available even if brightness is disabled (ie: on PC with no webcam available, dimmer module will work anyway)
  • Defaults dimmer timeouts are now shorter
  • Small code improvements
  • Fixed a bug in sunrise/sunset algorithm

v2.0

04 Mar 09:21
Compare
Choose a tag to compare

This new release focused around adding support for external monitors (and thus both multi-monitor setups and desktop PCs).

  • Shorten comment in desktop file
  • Fixed a very rare issue spotted by cppcheck
  • Location callbacks will now check for distance between old location and new one, before triggering
  • User location as loaded by cmdline opts or config file, is now validated for sanity
  • Added codacy
  • Updated to new clightd 2.0 interface; dropped gamma/dimmer and brightness _smooth modules
  • Dropped weather and networkmanager modules. Weather was really useless.
  • Fixed some small merge issues
  • Brightness module can now be disabled too allowing to eg: run clight as redshift on desktop PCs without webcam
  • Autodisable brightness module on PCs without webcam
  • Added a clightd version check at clight startup

v1.4

10 Sep 09:24
Compare
Choose a tag to compare

Changelog:

  • Reworked configuration log in log file
  • Added a Weather module to shorten interval between webcam captures based on current cloudiness.
    Note that this feature needs an OpenWeatherMap apikey setted in conf file, otherwise it is disabled.
  • Added a Network module that will listen on NetworkManager StateChanged event, to let clight know when connection is up. For now, this is only used by Weather module to pause it when network is off, and resume it when it is back on.
  • Lots of small bugfixes and improvements
  • Build release with -O3