]> git.openpandora.org Git - pandora-libraries.git/commitdiff
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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1de2be9a115253bc96f3f0b9b1586ed0f7feae13 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f8df2601b209697e31015475f72dda5ac90ee9ee 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