diff --git a/AutomaticBrightness.sh b/AutomaticBrightness.sh index 5056a71..e39adb6 100755 --- a/AutomaticBrightness.sh +++ b/AutomaticBrightness.sh @@ -146,17 +146,29 @@ do NewLight=$(( $DiffCount )) + + CurrentBrightness=$(cat $BLightPath) + FakeLight=$(( $NewLight + $CurrentBrightness)) + + if [[ $FakeLight -gt $MaxScreenBrightness ]] + then + NewLight=$MaxScreenBrightness + echo "ERROR" + else + echo $FakeLight > $BLightPath + fi + # Format values apropriatly for brightnessctl - if [[ $NewLight -lt 0 ]] - then - NewLight=$( echo "$NewLight" | awk -F "-" {'print$2'}) - NewLight=$(echo $NewLight-) - else - NewLight=$(echo +$NewLight) - fi - + #if [[ $NewLight -lt 0 ]] + #then + #NewLight=$( echo "$NewLight" | awk -F "-" {'print$2'}) + #NewLight=$(echo $NewLight-) + #else + #NewLight=$(echo +$NewLight) + #fi + # Adjust brightness relativly - brightnessctl -q s $NewLight + #brightnessctl -q s $NewLight # Sleep for the screen Hz time so he effect is visible sleep $AnimationDelay diff --git a/README.md b/README.md index 478b5c8..bbba596 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,10 @@ based on 2017 MacBook Pro read ```Configuration``` for detailed informatoion about what options you have to easily customize/ adjust the bightness or animation speed ## Requires -brightnessctl +For running in as your user you need to be part of the ```vidoe``` group +```sudo usermod -a -G vido $USER``` if your not apart of the group + +If your installing as a system service your user dose not need to be apart of the group ## Non 12th Gen Intel Framework Owners Your sensor has a diffrent range thant the 12th Gen Intel Framework laptop sensors, please see chart bellow