From ce8d417e0c9fffdca2aa7a21917d0aef14d8699f Mon Sep 17 00:00:00 2001 From: fewtarius Date: Thu, 7 Apr 2022 17:30:40 -0400 Subject: [PATCH] Fix brightness restore on RG351x devices. --- packages/jelos/sources/autostart/common/006-brightness | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/jelos/sources/autostart/common/006-brightness b/packages/jelos/sources/autostart/common/006-brightness index 1dbc6394c..d6198eb4d 100755 --- a/packages/jelos/sources/autostart/common/006-brightness +++ b/packages/jelos/sources/autostart/common/006-brightness @@ -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}