From: Michael Mrozek Date: Thu, 26 Aug 2010 02:23:08 +0000 (+0200) Subject: op_bright_up.sh / op_bright_down.sh: Fixed them and enhanced them X-Git-Tag: sz_beta3~131 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55fc118db2513d17be99e46baa6c640249f991ff;p=pandora-libraries.git op_bright_up.sh / op_bright_down.sh: Fixed them and enhanced them (change brightness more linear) --- diff --git a/testdata/scripts/op_bright_down.sh b/testdata/scripts/op_bright_down.sh index e69de29..1de2be9 100755 --- a/testdata/scripts/op_bright_down.sh +++ b/testdata/scripts/op_bright_down.sh @@ -0,0 +1,19 @@ +#!/bin/bash +cur=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness); +if [ "$cur" -gt "40" ]; then + new=$(($cur-10)) +elif [ "$cur" -gt "30" ]; then + new=$(($cur-7)) +elif [ "$cur" -gt "20" ]; then + new=$(($cur-5)) +elif [ "$cur" -gt "5" ]; then + new=$(($cur-3)) +elif [ "$cur" -gt "0" ]; then + new=$(($cur-1)) +fi + +if [ "$new" -lt "0" ]; then + new=0 +fi + +echo $new > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness diff --git a/testdata/scripts/op_bright_up.sh b/testdata/scripts/op_bright_up.sh index e69de29..f8df260 100755 --- a/testdata/scripts/op_bright_up.sh +++ b/testdata/scripts/op_bright_up.sh @@ -0,0 +1,21 @@ +#!/bin/bash +cur=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness); +if [ "$cur" -gt "35" ]; then + new=$(($cur+10)) +elif [ "$cur" -gt "20" ]; then + new=$(($cur+7)) +elif [ "$cur" -gt "13" ]; then + new=$(($cur+5)) +elif [ "$cur" -gt "5" ]; then + new=$(($cur+3)) +elif [ "$cur" -gt "0" ]; then + new=$(($cur+1)) +elif [ "$cur" -eq "0" ]; then + new=$(($cur+1)) +fi + +if [ "$new" -gt "54" ]; then + new=54 +fi + +echo $new > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness