op_cpuspeed.sh: allow to disable 'stupid' quistions
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_bright_down.sh
1 #!/bin/bash
2
3 . /usr/pandora/scripts/op_paths.sh
4
5 cur=$(cat $SYSFS_BACKLIGHT_BRIGHTNESS)
6 if [ "$cur" -gt "40" ]; then
7    new=$(($cur-10))
8 elif [ "$cur" -gt "30" ]; then 
9    new=$(($cur-7))
10 elif [ "$cur" -gt "20" ]; then 
11    new=$(($cur-5))
12 elif [ "$cur" -gt "5" ]; then 
13    new=$(($cur-3))
14 elif [ "$cur" -gt "0" ]; then 
15    new=$(($cur-1))
16 fi
17
18 if [ "$new" -lt "3" ]; then
19    new=0
20 fi
21
22 echo $new > $SYSFS_BACKLIGHT_BRIGHTNESS