Fix brightness restore on RG351x devices.

This commit is contained in:
fewtarius 2022-04-07 17:30:40 -04:00
parent ec89e3b701
commit ce8d417e0c
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A

View file

@ -17,5 +17,9 @@ then
BRIGHTNESS=3
fi
BRIGHTNESS=$(printf "%.0f" ${BRIGHTNESS})
printf "%.0f" $(echo "${BRIGHTNESS} * 2.56" | bc) > /sys/class/backlight/backlight/brightness
if [ "$(cat /sys/class/backlight/backlight/max_brightness)" = 255 ]
then
FACTOR="* 2.56"
fi
printf "%.0f" $(echo "${BRIGHTNESS} ${FACTOR}" | bc) > /sys/class/backlight/backlight/brightness
set_setting system.brightness ${BRIGHTNESS}