Commit 38f71e8
committed
Add support for an ambient light sensor.
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 38f71e8
3 files changed
Lines changed: 589 additions & 1 deletion
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
| |||
0 commit comments