This project concerns a collection of Bash scripts I have written/modified and used to prepare and utilize custom brightness scaling on my Acer C720P. Preferred brightness levels are stored with the corresponding ALS (Ambient Light Sensor) IR reading, and the data is fit by a linear equation to be used when determining the automatic brightness level. Right now this is really young, and I am not quite sure where I want it to end up, but I think this could be the base for an actually useful automatic backlight daemon. =)
gnuplot
bc
- ALS: isl29018 driver
CONFIG_SENSORS_ISL29018={y,m}
- C720 patchset (more on this later)
Ensure that all paths in the script(s) are set properly.
Set the backlight to a comfortable level. Run blstore
.
This will store the current ALS reading and backlight level in bl.dat
for
later use by gnuplot
. I recommend running this script (remember to modify
your brightness first) whenever it pops into your mind to populate the data
over time, removing outliers whenever necessary.
When you run gnuplot bl.gpi
, the slope and y-intercept of your
brightness fit will be stored in blsettings
, which is then sourced by
backlightd
. Use the --persist
flag to view the visualization.
Note: You may have to manually remove outliers. Simply delete the offending
line(s) in bl.dat
.
No installation for now, just some scripts.
- Store values:
blstore
(meant to populate bl.dat with sensor values) - Store linear fit coefficients and [render visualization]:
gnuplot [--persist] bl.gpi
- Enjoy reasonable backlight levels:
backlightd &
- General clean-up
- Polish scripts to be professional grade
gnuplot
is nice for visualization, but there must exist a more lean option for pure calculation- Raw ALS IR readings can be misleading and sporadic. Can we filter these
outliers without manually editing
bl.dat
?
- There are so many options for polling procedures. I wonder what people will prefer.
- Extend to support more devices (ALS specifically; backlight support is trivial)
- I love Bash, but pure C is cool too! Maybe a future port would be nice...