This is a WIP/RFC
This is WIP, please excuse the blunt g_print()s and naive code
gsd-power controls how the desktop changes brightness on key events, or when adjusting gnome-shell or gnome-control-center brightness sliders.
This API takes a value from 0-100, representing a 1:1 relation to the backlight's brightness level. This range is divided by default into 20 steps, this means that you have 20 equally spaced brightness settings to choose from.
However, the above presents a usability problem when trying to adjust brightness on the lowest levels, where you probably want a more nuanced and finer control.
For example, on my MacBookPro11,1 (2013, intel_backlight), gsd-power folows this progression:
* value: 11 - 82 - 152 - ... - 1328 - 1388
* step: 01 - 02 - 03 - ... - 20 - 21
On the other hand, on its native OSX, the following progression is followed:
* value: 22 - 37 - 56 - ... - 1140 - 1385
* step: 01 - 02 - 03 - ... - 15 - 16
This approach is much more usable in that it allows nuance in the lowest settings, where it is much more visible to people with sensitive eyes, or in low light situations like a dark room.
This commit introduces an ease-in curve that takes 0-100 values from the API/UI and translates them into ease'd-in values and sets those transparently to anyone using gsd-power API (shell/settings/dbus).
Curve comparison
Note that the actual implementation follows gsd's current number of steps, and not only 16 like in the comparison
Full range of values/steps
Step | Linux | 0-100 | Mac | 0-100 | WIP | ||
---|---|---|---|---|---|---|---|
1 | 11 | 1 | 22 | 2 | 18 | ||
2 | 82 | 6 | 37 | 3 | 40 | ||
3 | 152 | 11 | 56 | 4 | 66 | ||
4 | 218 | 16 | 80 | 6 | 96 | ||
5 | 288 | 21 | 110 | 8 | 131 | ||
6 | 359 | 26 | 147 | 11 | 171 | ||
7 | 430 | 31 | 192 | 14 | 219 | ||
8 | 495 | 36 | 248 | 18 | 274 | ||
9 | 566 | 41 | 315 | 23 | 339 | ||
10 | 637 | 46 | 397 | 29 | 415 | ||
11 | 708 | 51 | 495 | 36 | 506 | ||
12 | 773 | 56 | 614 | 44 | 616 | ||
13 | 844 | 61 | 757 | 55 | 752 | ||
14 | 914 | 66 | 931 | 67 | 926 | ||
15 | 985 | 71 | 1140 | 82 | 1153 | ||
16 | 1051 | 76 | 1385 | 100 | 1385 | ||
17 | 1121 | 81 | |||||
18 | 1192 | 86 | |||||
19 | 1263 | 91 | |||||
20 | 1328 | 96 | |||||
21 | 1388 | 101 |