pandora-scripts: Moved scripts from libpnd-GIT to a proper place :)
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_bright_down.sh
1 #!/bin/bash
2 cur=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness);
3 if [ "$cur" -gt "40" ]; then
4    new=$(($cur-10))
5 elif [ "$cur" -gt "30" ]; then 
6    new=$(($cur-7))
7 elif [ "$cur" -gt "20" ]; then 
8    new=$(($cur-5))
9 elif [ "$cur" -gt "5" ]; then 
10    new=$(($cur-3))
11 elif [ "$cur" -gt "0" ]; then 
12    new=$(($cur-1))
13 fi
14
15 if [ "$new" -lt "3" ]; then
16    new=0
17 fi
18
19 echo $new > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness