summaryrefslogtreecommitdiff
path: root/recipes/zaurusd/files/zaurus-hinge.bl-on
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/zaurusd/files/zaurus-hinge.bl-on
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/zaurusd/files/zaurus-hinge.bl-on')
-rw-r--r--recipes/zaurusd/files/zaurus-hinge.bl-on63
1 files changed, 63 insertions, 0 deletions
diff --git a/recipes/zaurusd/files/zaurus-hinge.bl-on b/recipes/zaurusd/files/zaurus-hinge.bl-on
new file mode 100644
index 0000000000..58227e8c5a
--- /dev/null
+++ b/recipes/zaurusd/files/zaurus-hinge.bl-on
@@ -0,0 +1,63 @@
+#! /bin/sh
+#
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2006
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
+#
+# Filename: zaurus-hinge.bl-on
+# Date: 04-Jun-06
+
+test -z "${ZD_BINDIR}" && ZD_BINDIR="/usr/bin"
+test -x ${ZD_BINDIR}/bl && ${ZD_BINDIR}/bl on
+
+
+BL="fakeBl"
+
+fakeBl() {
+
+
+ case "$1" in
+ on) test -n "$2" && echo "$2" > "$BL_DRIVER" ;;
+ "") echo "on `cat "$BL_DRIVER"`";;
+ *) echo "$1" > "$BL_DRIVER" ;;
+ esac
+
+}
+
+for dir in `ls -1 /sys/class/backlight/`
+do
+ if test -e /sys/class/backlight/$dir/brightness
+ then
+ echo "Using [$dir] backlight driver"
+ BL_DRIVER="/sys/class/backlight/$dir/brightness"
+ break
+ fi
+done
+
+
+echo "### `$BL` ###"
+( if test "`$BL | awk '{print $2}'`" = "0"
+then
+
+ $BL 20
+
+ if mkdir /var/run/display_brightness.lock
+ then
+ if test -e /var/run/display_brightness.tmp
+ then
+ OLD_VALUE="`cat /var/run/display_brightness.tmp`"
+ echo "OLD BRIGHTNESS SETTING FOUND: $OLD_VALUE"
+
+ if test "$OLD_VALUE" -gt 1
+ then
+ echo "SETTING $OLD_VALUE!"
+ $BL "$OLD_VALUE"
+ rm /var/run/display_brightness.tmp
+ echo "FINISH!"
+ fi
+ fi
+ rm -rf /var/run/display_brightness.lock
+ else
+ echo "BRIGHTNESS IS LOCKED"
+ fi
+fi ) &
+