summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Hentges <oe@hentges.net>2006-05-25 22:07:52 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-05-25 22:07:52 +0000
commit7b9d7be0ce864c84d6098c1c8521bd2a84633874 (patch)
treedb9a8d128c0b3b00963c181023374a30d369315a
parent579d6238e817ea11c8b7b09aff2cf36c71027173 (diff)
display-brightness: Use head -n 1 not head -1 to determine driver, closing bug #1004. Also fixed a problem with poodles kernel 2.6 driver and added a small help text
-rw-r--r--packages/display-brightness/display-brightness.sh12
-rw-r--r--packages/display-brightness/display-brightness_1.0.0.bb2
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"