Skip to content

Commit 734fd60

Browse files
authored
Add support for an ambient light sensor. (#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.
1 parent 69711a0 commit 734fd60

3 files changed

Lines changed: 589 additions & 1 deletion

File tree

data/org.cinnamon.settings-daemon.plugins.power.gschema.xml.in.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<schemalist>
22
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.cinnamon.settings-daemon.plugins.power" path="/org/cinnamon/settings-daemon/plugins/power/">
3+
<key name="ambient-enabled" type="b">
4+
<default>true</default>
5+
<summary>Enable the ambient light sensor</summary>
6+
<description>If the ambient light sensor functionality is enabled.</description>
7+
</key>
38
<key name="idle-brightness" type="i">
49
<default>30</default>
510
<summary>The brightness of the screen when idle</summary>

0 commit comments

Comments
 (0)