summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Boor <florian.boor@kernelconcepts.de>2006-03-15 15:16:11 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-03-15 15:16:11 +0000
commit121c25f088383091f78774cc8c8453987e23dc10 (patch)
treef35d7eea3eee08b88e4d4bf7e2ba341dd4791317
parent4180227db3bd725ce340f36add09af0c9bbeb8ca (diff)
display-brightness: Add 1.0.0 contributed by Patrick Steiner.
-rw-r--r--packages/display-brightness/.mtn2git_empty0
-rw-r--r--packages/display-brightness/display-brightness.sh41
-rw-r--r--packages/display-brightness/display-brightness_1.0.0.bb14
3 files changed, 55 insertions, 0 deletions
diff --git a/packages/display-brightness/.mtn2git_empty b/packages/display-brightness/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/display-brightness/.mtn2git_empty
diff --git a/packages/display-brightness/display-brightness.sh b/packages/display-brightness/display-brightness.sh
new file mode 100644
index 0000000000..8141866858
--- /dev/null
+++ b/packages/display-brightness/display-brightness.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# display-brightness.sh
+# simple script to set display-brightness for zaurus clamshell
+# author: patrick steiner <patrick.steiner@a1.net>
+# version: 1.00 | 22.02.2005 23:20
+
+
+STEP=5
+MAX_BRIGHTNESS=`cat /sys/class/backlight/*/max_brightness`
+ACTUAL_BRIGHTNESS=`cat /sys/class/backlight/*/actual_brightness`
+BRIGHTNESS_FILE="/sys/class/backlight/*/brightness"
+
+if [ ! -n "$1" ]; then
+ exit 0
+fi
+
+if [ "$1" = "up" ]; then
+ if [ $ACTUAL_BRIGHTNESS -eq $MAX_BRIGHTNESS ]; then
+ exit 0
+ else
+ let CURRENT_BRIGHTNESS=$ACTUAL_BRIGHTNESS+$STEP
+ echo $CURRENT_BRIGHTNESS >> $BRIGHTNESS_FILE
+ exit 0
+ fi
+fi
+
+if [ "$1" = "down" ]; then
+ if [ $ACTUAL_BRIGHTNESS -eq 0 ]; then
+ exit 0
+ elif [ $ACTUAL_BRIGHTNESS -lt $STEP ]; then
+ STEP=1
+ let CURRENT_BRIGHTNESS=$ACTUAL_BRIGHTNESS-$STEP
+ echo $CURRENT_BRIGHTNESS >> $BRIGHTNESS_FILE
+ exit 0
+ else
+ let CURRENT_BRIGHTNESS=$ACTUAL_BRIGHTNESS-$STEP
+ echo $CURRENT_BRIGHTNESS >> $BRIGHTNESS_FILE
+ 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
new file mode 100644
index 0000000000..e275b3f8bc
--- /dev/null
+++ b/packages/display-brightness/display-brightness_1.0.0.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "display brightness utility"
+AUTHOR = "Patrick Steiner <patrick.steiner@a1.net>"
+MAINTAINER = "Patrick Steiner <patrick.steiner@a1.net>"
+DEPENDS = ""
+PRIORITY = "optional"
+PR = "r0"
+LICENSE = "GPLv2"
+
+SRC_URI = "file://display-brightness.sh"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/display-brightness.sh ${D}${bindir}/
+}