steel99xl / Mac-like-automatic-brightness

A simple script to provide a "Mac" like automatic brightness adjustemnt/ animation
17 stars 4 forks source link

Decrease CPU Usage and Set smoothly actual_brightness = 1 when in_illuminance_raw<1 #2

Closed Theluga closed 11 months ago

Theluga commented 11 months ago

I don't know if it is because my laptop has different sensors, but I changed your script a little. In my DELL inspiron 7359 the brightness was at 68 fixed when illuminance was 0.

So I made it go to 1. Also, my sensors of anbient light is 5, device0 is for hysteresis.

I renamed it to txt because github. Feel free to use it as see fit. Just sharing. Thank you very much for your script. I'm loving it. And I may have named things backwards rsrs

I also limited its priorities so now it runs with very little resources... autobrightness .sh.txt

steel99xl commented 11 months ago

Thank you, ill definitely be adding the process priority change. whats the range for your sensor and your screen? you might have to change the scale factor to get better match for the animation not being similar going up or down in brightness (the information will also be added to the table in the README so can I also get the year of your laptop, thank you)

Theluga commented 11 months ago

Your script had a typo when you set the the priority variable without renaming cpu_limit when calling it.

I did a fork from your repo and created this autobrightness.sh

I think it is easier to set variables. About my sensor range: I think its from 0 to 15000 (measured with my phone flashlight, take it with a grain of salt).

About the darker mode, when the illuminance is less than 1 i.e. 0, it will go to the target brightness that is 1. The target Can be easily changed.

If the file AB.offset have 0 as value. Darker mode is activated and setting brightness will reset to target value 1 when illuminance is less than 1. if the file has value of 1, it will be the normal mode and the screen brightness can be adjusted until the illuminance sensor changes.

Thank you very much!