Clight Versions Save

A C daemon that turns your webcam into a light sensor. It will adjust screen backlight based on ambient brightness.

4.11

2 months ago

Hey everyone, long time no see :) I am still a bit busy with real life, but finally found the time to tag Clight 4.11, that comes with some bugfixes:

What's Changed

New Contributors

Full Changelog: https://github.com/FedeDP/Clight/compare/4.10...4.11

4.10

11 months ago

Hi everyone! Welcome to another 4.x series Clight release! What are the latest goodies? Let's dive into them!

Generic

  • CI was ported to github actions
  • Clight will now smartly handle signals: SIGUSR1 will trigger a capture, SIGTSTP will pause and SIGCONT will resume it

Config file

  • The config file will now be installed under /etc/clight/clight.conf by default, and will include each module config from /etc/clight/modules.conf.d folder. This leads to much cleaner and simpler experience when looking for a configuration key.
  • To retain backward compatibility, old config path is still supported; its support will however be dropped when jumping at the 5.x release!

PM

  • Added support for logind inhibition

Screen

  • fix screen_br reset upon pause

Backlight

  • Wait some time (configurable) before refreshing gamma/backlight on interface changes

Gamma

  • Refresh gamma on interface removed too
  • Added a Toggle method exposed by org.clight.clight.Conf.Gamma to toggle between states' temps
  • Added a Toggle Gamma new desktop file action

As always, wiki pages have been updated to reflect the new changes! Also, thanks to @tpeacock19 for its first contributions and great help (and patience!).

Follows the list of changes autogenerated from github.

What's Changed

New Contributors

Full Changelog: https://github.com/FedeDP/Clight/compare/4.9...4.10

4.9

1 year ago

Hi all! Here is a new Clight release! Development pace slowed down a bit, but i am still trying my best to provide the best out of the box experience ;) This release mainly sees a big new feature, that also carries a configuration break. Some bugs were also fixed of course :smile:

Changes

  • feat: fully reworked SCREEN module to provide better screen-content brightness adjustments
  • feat: added a desktop file action to force-set correct screen temperature for current day time
  • fix: allow back custom modules to use log macros (DEBUG, INFO, WARN)
  • chore: new default location for log file is under XDG_RUNTIME_DIR (by default /run/user/X/clight/clight.conf), because new screen module is "constantly" (ie: every 5s by default on AC) writing to log file, and wanted to avoid any harm to SSD, given that XDG_RUNTIME_DIR is mounted in tmpfs

4.8

2 years ago

Hi! Welcome to another release of Clight! This release cycle greatly benefits from new Clightd goodies!
Moreover, it also showcases initial support for Pinephone, even if not perfect yet.
Be sure to follow https://github.com/FedeDP/Clight/issues/233 if you are interested (any help is appreciated though, because i do not own the device).

Improvements

Pinephone

  • Allow upower module even if LidIsPresent is false
  • Properly call systemd logind .SetIdleHint API on dimming/dpms
  • Manage systemd logind.IdleHint states when Clight dimmer is disabled
  • If DIMMER is disabled but we receive an IdleHint, do not touch backlight; just manage the new DIMMED state eventually pausing backlight and other modules. This in theory should allow Clight to manage backlight dimming caused by external source, eg: a DE power manager, when relying on external dimmer, just like its internal dimming
  • Always start DISPLAY module

Backlight

  • Ported to new Clightd Backlight2 api
  • on objectadded (ie: new monitors), properly set current backlight + current gamma temp on new monitor
  • Support for monitor hotplug thanks to new Clightd 5.5 (and ddcutil 1.2.0)
  • Dropped screen_sysname conf because with Backlight2 api it was indeed useless
  • Added a new conf option trans_fixed to set a fixed transition duration in milliseconds. This means that any backlight transition will last the same, like going from 0.9 to 0.2 will last exactly like going from 0.5 to 0.3.
    It allows a far smoother experience when enabled, IMO.

Dimmer

  • Added a new conf option array trans_fixed to set a fixed transition duration in milliseconds for dimmer enter or leave

Wizard

  • Port to backlight2

Daytime

  • Add support for sunrise and sunset events offsets, eg: sunrise event should be considered 10m before the real sunrise.

Generic

  • Finally allow to view usage, help and version messages while another instance is running
  • Show commit hash in Clight version
  • do not use strlen() just to check that string is not empty

Fixes

Interface

  • Fixed null ptr dereference in inhibit_parse_msg()
  • Actually set conf location when a new one is set through dbus API

4.7

2 years ago

Hi! Welcome to another release of Clight! This releaase cycle was quite short but it brings lots of goodies! Let's start!

Features

  • Keyboard backlight is now specified as a curve for AC and BATT states, just like screen backlight
  • Geoclue GetClient call is now async to avoid "freezing" for 20s waiting on geoclue daemon to answer on startup
  • Dbus API does now expose MonitorOverride api

Improvements

  • Stop Gamma module where not supported
  • Added a timeout of 30s for waiting on geoclue; if no location is received, kill Location module (it avoids weird situations where there is no cached location and clight awaits forever for geoclue to give a location)
  • Improved geoclue error handling with meaningful messages
  • Deregister modules instead of just stopping them where unsupported/in case of init errors, so that they won't waste resources
  • When a module is deregistered, its bus api is killed too
  • Plot backlight curves directly using fit parameters instead of using x and y loaded from config (makes much more sense)
  • Plot backlight curve for any curve (backlight, monitor_override and keyboard), but only in verbose mode

Fixes

  • Fixed a memleak: properly free monitor override map
  • Fixed curve data points validation for custom module requests

Configuration changes

  • Dropped keyboard.ambient_threshold as it is now superseeded by new keyboard curve
  • Added keyboard.ac_regression_points and keyboard.batt_regression_points

As always, I hope you will enjoy this new release!

4.6

2 years ago

Hi everyone! Welcome to Clight 4.6; it introduces an highly awaited feature:

Features

Backlight

Inhibit

  • added back a conf option to disable inhibit module
  • added back inhibit_bl conf option

Gamma

  • allow to automatically restore screen temperature upon clight exit

Generic

  • manage sd-login session.Active state property, pausing clight when session is not active (eg: when you switch user, old user clight will now get paused if using systemd)

Fixes

Conf

  • properly dump "disabled" bool in StoreConf for each module

Upower

  • fix bug in lid state initialization

Hope you enjoy this new release!

4.5

3 years ago

Hi everyone. here is a new shiny Clight release! It is just a small bugfix release; anyway, bugfixing is always highly appreciated i guess.

Fixes

  • Fixed a couple of mostly stupid bug in wizard
  • Avoid touching screen temperature in ambient_gamma mode when entering dim state
  • Properly send SUNRISE/SUNSET updates with time_t values

Hope you enjoy it!

4.4

3 years ago

Welcome to Clight 4.4.
This new release just adds a small bugfix:

  • Fixed segfault case on dbus introspection

Hope you enjoy it!

4.3

3 years ago

Hi everyone,
welcome to Clight 4.3!

This release brings lots of small and great fixes, improvements and some new features;
but first of all, i've got a couple of big news:

  • Clight has now a GUI!! Many thanks to @nullobsi that developed a QT gui: https://github.com/nullobsi/clight-gui; be sure to check it out!
  • Clight has now 2 more contributors; please welcome @nullobsi and @promeneur! They will help with the wiki pages and well, whatever they like to, really. Thank you!

Clight-gui helped testing all Clight dbus API, revealing some small bugs and crashes here and there.
Ok, no more waiting, let's dive in the new release!

Backlight

  • Clamp backlight values between first backlight curve value and last one, ie: never get out of backlight curve's limits

Interface

  • Fixed crash when writing Sunrise/Sunset dayconf properties from dbus
  • Remember that 'b' dbus type maps to int when reading from sd_bus_message. This fixes a weird stack-smashing crash.
  • Allow to unset Sunrise/Sunset from dbus api

Keyboard

  • Switch to use new KEYBOARD api offered by Clightd
  • Add support for StopTimeout (keyboard dimming)
  • Keyboard backlight does now follow backlight curve (not ambient brightness!)

Gamma

  • Do not use state.current_bl_pct in ambient_callback() as it may still have old value (it is now updated in dbus match on_bl_changed, async)
  • Only call ambient_callback() on target bl changes, not step ones
  • Dynamically react to ambient gamma value updates
  • When ambient gamma is enabled, properly react to interface gamma temp updates

Sensor

  • Fixed sensor captures config parsing

Generic

  • Added a man page!
  • Added fish and zsh completion scripts, thanks @NICHOLAS85!
  • Finally fixed #106!! After only 15 months!

Here it is; thank you very much for helping me with bugs discovery, with the testing and, well, with the partecipation in the project and the enthusiasm!
Bye!

4.2

3 years ago

Hi! I am very proud to announce Clight 4.2 release;
It comes with lots of goodies; bugfixes and some new features.
Let's dive into the changes!

Backlight

  • Added an option to fire a calibration whenever lid gets opened
  • Actually plot AC/BATT curves for backlight, in wizard mode too (this is just for fun anyway!)
  • Fix timeout set on daytime_upd
  • Hook to new Clightd Backlight.Changed signal and emit each step BL_UPD for smooth transitions

Screen

  • Enable it on tty and wayland too

Dpms

  • Hook to new Clightd 5.0 Dpms.Changed signal to react to external (through clightd) dpms state changes
  • Enable it on wayland too

Gamma

  • Enable it on tty and wayland too
  • Hook to new Clightd 5.0 Gamma.Changed signal and emit each step TEMP_UPD for smooth transitions

Keyboard

  • Fixed keyboard backlight setting

Inhibition

  • Fix inhibiton counter going crazy if lots of inhibit requests are quickly sent to clight

Location

  • Avoid geoclue continuously spamming clight new locations

Wizard

  • Fixed wizard mode to actually work

Generic

  • Fixed Clight desktop file (thanks Sonico98!)
  • Fixed Clightd dbus-activation when firstly called by Clight
  • Added a dbus hook on systemd-logind PrepareForSleep signal that will pause any feature module. This fixes some issues with clight being too quick to resume from suspend, leading to GAMMA/SCREEN errors as X server was still not resumed.
  • Added a resumedelay conf option to let clight wait N seconds before resuming modules on system resume from sleep (useful in case above error is still present)
  • Expose a "Pause" dbus API to pause clight as if system was suspended
  • Fixed some longstanding bugs with negative timeouts in reset_timer()
  • Actually check that timerfd_gettime() succeed before using its value
  • Fix wrong timeout set on resume after a long night
  • Added a zsh completion script (thanks NICHOLAS85!)

As always, many thanks to users who contributed either with some PR or simply through issues, discussions or just some kind words for Clight;
I cannot express how much this encourages me going on with the development :)
Thank you very much everyone!

Clight does now require Clightd 5.0! As always, wiki pages were updated to reflect the changes.

Finally, we are moving away from this weird 2020; let's hope for a brighter future!
Merry xmas everyone!