Add support for ambient light sensor#444
Merged
mtwebster merged 1 commit intolinuxmint:masterfrom Mar 24, 2026
Merged
Conversation
6be5f9e to
d37de8b
Compare
mtwebster
added a commit
to mtwebster/Cinnamon
that referenced
this pull request
Mar 20, 2026
Detects support via csd-power's dbus proxy, and adds switches to toggle auto-brightness. ref: linuxmint/cinnamon-settings-daemon#444
Connects to net.hadess.SensorProxy, if available, to check for
support, and monitor sensor changes.
When the environment becomes brighter, the backlight increases -
if the environment darkens, the backlight decreases.
- At daemon start. takes current backlight level and ambient level
and uses it as the base state for future adjustments.
- Any deliberate brightness changes by the user, or by dim-timers
causes renormalization.
- Upon sensor change:
- A 3 second stabilization period begins. Any further sensor
change during this period will restart its timer.
- After stabilization, the new backlight % is determined. If
4% of current, nothing is done.
- If the backlight is to be updated, it is performed gradually
over a 3 second period.
- Sensor changes are ignored during transition, and 500ms after.
I tried a couple of iterations of gnome-settings-daemon's
implementation and found them much too sensitive (and distracting).
I've tried to minimize random light 'noise' interfering as much -
temporarily blocking a light source as I move, etc... I don't think
anything can be perfect, and probably not all light sensors will be
made the same, either.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connects to
net.hadess.SensorProxy, if available, to check forsupport, and monitor sensor changes.
When the environment becomes brighter, the backlight increases -
if the environment darkens, the backlight decreases.
and uses it as the base state for future adjustments.
causes renormalization.
change during this period will restart its timer.
4% of current, nothing is done.
over a 3 second period.
I tried a couple of iterations of gnome-settings-daemon's
implementation and found them much too sensitive (and distracting).
I've tried to minimize random light 'noise' interfering as much -
temporarily blocking a light source as I move, etc... I don't think
anything can be perfect, and probably not all light sensors will be
made the same, either.
ref:
linuxmint/cinnamon#13649