diff options
author | Matthias Hentges <oe@hentges.net> | 2006-05-26 09:01:56 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-05-26 09:01:56 +0000 |
commit | d0487e1763471b2ceda3e4aa7c246a1d7ce114c4 (patch) | |
tree | 0f3bc2250088ebae1b997c1bbcc4307791d85186 /packages | |
parent | fc01153a70f73eff6c272ae705b1a6a0192055b4 (diff) | |
parent | 7b9d7be0ce864c84d6098c1c8521bd2a84633874 (diff) |
merge of 543f1ae1d5c52bf6c18d56d34bb9f3aebcffdfcb
and f58607b4b148968934281d92d207a505988286e5
Diffstat (limited to 'packages')
-rw-r--r-- | packages/display-brightness/display-brightness.sh | 12 | ||||
-rw-r--r-- | packages/display-brightness/display-brightness_1.0.0.bb | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/packages/display-brightness/display-brightness.sh b/packages/display-brightness/display-brightness.sh index 4e706e1e75..5e1a0e97d4 100644 --- a/packages/display-brightness/display-brightness.sh +++ b/packages/display-brightness/display-brightness.sh @@ -7,11 +7,17 @@ STEP=5 -DRIVER="`ls /sys/class/backlight/|head -1`" +DRIVER="`ls /sys/class/backlight/|head -n 1`" MAX_BRIGHTNESS=`cat /sys/class/backlight/$DRIVER/max_brightness` ACTUAL_BRIGHTNESS=`cat /sys/class/backlight/$DRIVER/actual_brightness` BRIGHTNESS_FILE="/sys/class/backlight/$DRIVER/brightness" +if test "$1" != "up" -a "$1" != "down" -a -n "$1" +then + echo -e "\nUsage:\n\t `basename $0` [up | down]\n" + exit 0 +fi + echo "max / current" echo "$MAX_BRIGHTNESS / $ACTUAL_BRIGHTNESS" if [ ! -n "$1" ]; then @@ -22,7 +28,8 @@ if [ "$1" = "up" ]; then if [ $ACTUAL_BRIGHTNESS -eq $MAX_BRIGHTNESS ]; then exit 0 else - let CURRENT_BRIGHTNESS=$ACTUAL_BRIGHTNESS+$STEP + test "$STEP" -gt "$MAX_BRIGHTNESS" -o "$STEP" -eq "$MAX_BRIGHTNESS" && STEP=1 + let CURRENT_BRIGHTNESS=$ACTUAL_BRIGHTNESS+$STEP echo $CURRENT_BRIGHTNESS >> $BRIGHTNESS_FILE exit 0 fi @@ -42,3 +49,4 @@ if [ "$1" = "down" ]; then exit 0 fi fi + diff --git a/packages/display-brightness/display-brightness_1.0.0.bb b/packages/display-brightness/display-brightness_1.0.0.bb index 1919f98231..87725cfa39 100644 --- a/packages/display-brightness/display-brightness_1.0.0.bb +++ b/packages/display-brightness/display-brightness_1.0.0.bb @@ -3,7 +3,7 @@ AUTHOR = "Patrick Steiner <patrick.steiner@a1.net>" MAINTAINER = "Patrick Steiner <patrick.steiner@a1.net>" DEPENDS = "" PRIORITY = "optional" -PR = "r1" +PR = "r2" LICENSE = "GPLv2" SRC_URI = "file://display-brightness.sh" |