op_bright_up.sh / op_bright_down.sh: Fixed them and enhanced them
authorMichael Mrozek <EvilDragon@openpandora.de>
Thu, 26 Aug 2010 02:23:08 +0000 (04:23 +0200)
committerMichael Mrozek <EvilDragon@openpandora.de>
Thu, 26 Aug 2010 02:23:08 +0000 (04:23 +0200)
(change brightness more linear)

testdata/scripts/op_bright_down.sh
testdata/scripts/op_bright_up.sh

index e69de29..1de2be9 100755 (executable)
@@ -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
index e69de29..f8df260 100755 (executable)
@@ -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