diff options
author | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2007-11-29 22:52:57 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2007-11-29 22:52:57 +0000 |
commit | 893391922a439ff9b2695d2e9e91c6060348bc41 (patch) | |
tree | d7380106d61494bba7ff06f7892407d65f044582 /packages/zaurusd/files | |
parent | 5a14f0b2120aa8004ead8422cb291f3aec0b9d01 (diff) | |
parent | ae7eb4076905d0b10613ba756acc9924e3d4fbaf (diff) |
merge of '2756e6b25efd4532c1a23fd31f68481d2f8b68a3'
and '9c32fcb38cb012f79311cd1b07560964873c6307'
Diffstat (limited to 'packages/zaurusd/files')
-rw-r--r-- | packages/zaurusd/files/zaurus-hinge.bl-off | 12 | ||||
-rw-r--r-- | packages/zaurusd/files/zaurus-hinge.bl-on | 28 | ||||
-rw-r--r-- | packages/zaurusd/files/zaurus-hinge.matchbox-landscape | 6 | ||||
-rw-r--r-- | packages/zaurusd/files/zaurus-hinge.matchbox-portrait | 5 |
4 files changed, 45 insertions, 6 deletions
diff --git a/packages/zaurusd/files/zaurus-hinge.bl-off b/packages/zaurusd/files/zaurus-hinge.bl-off index 888f90bfc5..ec3cefb2ca 100644 --- a/packages/zaurusd/files/zaurus-hinge.bl-off +++ b/packages/zaurusd/files/zaurus-hinge.bl-off @@ -6,5 +6,13 @@ # Filename: zaurus-hinge.bl-off # Date: 04-Jun-06 -test -z "${ZD_BINDIR}" && ZD_BINDIR="/usr/bin" -${ZD_BINDIR}/bl off +#test -z "${ZD_BINDIR}" && ZD_BINDIR="/usr/bin" +#${ZD_BINDIR}/bl off + + +STEP=5 +DRIVER="`ls /sys/class/backlight/|head -n 1`" +BRIGHTNESS_FILE="/sys/class/backlight/$DRIVER/brightness" + +cat "$BRIGHTNESS_FILE" > /var/run/display_brightness.tmp +echo 0 > "$BRIGHTNESS_FILE" diff --git a/packages/zaurusd/files/zaurus-hinge.bl-on b/packages/zaurusd/files/zaurus-hinge.bl-on index b9b0e68749..61598155f2 100644 --- a/packages/zaurusd/files/zaurus-hinge.bl-on +++ b/packages/zaurusd/files/zaurus-hinge.bl-on @@ -12,7 +12,7 @@ ${ZD_BINDIR}/bl on # If the backlight does not come back on after a suspend, the driver is # still "on" (hence "bl on" does nothing) with a brightness of "0" -if test "`bl | awk '{print $2}'`" = "0" +( if test "`bl | awk '{print $2}'`" = "0" then x=0 while test "$x" != 4 @@ -24,5 +24,29 @@ then let x=$x+1 done -fi + + 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 + STEP=5 + DRIVER="`ls /sys/class/backlight/|head -n 1`" + BRIGHTNESS_FILE="/sys/class/backlight/$DRIVER/brightness" + + echo "SETTING $OLD_VALUE!" + echo "$OLD_VALUE" > "$BRIGHTNESS_FILE" + rm /var/run/display_brightness.tmp + echo "FINISH!" + fi + fi + rm -rf /var/run/display_brightness.lock + else + echo "BRIGHTNESS IS LOCKED" + fi +fi ) & diff --git a/packages/zaurusd/files/zaurus-hinge.matchbox-landscape b/packages/zaurusd/files/zaurus-hinge.matchbox-landscape index e7b92b5140..a048769f7d 100644 --- a/packages/zaurusd/files/zaurus-hinge.matchbox-landscape +++ b/packages/zaurusd/files/zaurus-hinge.matchbox-landscape @@ -16,6 +16,10 @@ # urg mbinputmgr should kill below killproc ${ZD_BINDIR}/matchbox-keyboard killproc ${ZD_BINDIR}/matchbox-stroke + if [ -x ${ZD_BINDIR}/xrandr ]; then - xrandr -o normal + if ! ( xrandr | awk '{print $4}' | grep -q normal ) + then + ${ZD_BINDIR}/xrandr -o normal + fi fi diff --git a/packages/zaurusd/files/zaurus-hinge.matchbox-portrait b/packages/zaurusd/files/zaurus-hinge.matchbox-portrait index bd04d328cc..291617cd02 100644 --- a/packages/zaurusd/files/zaurus-hinge.matchbox-portrait +++ b/packages/zaurusd/files/zaurus-hinge.matchbox-portrait @@ -1,7 +1,10 @@ #!/bin/sh if [ -x ${ZD_BINDIR}/xrandr ]; then - ${ZD_BINDIR}/xrandr -o left + if ! ( xrandr | awk '{print $4}' | grep -q left ) + then + ${ZD_BINDIR}/xrandr -o left + fi fi # just to be extra safe sleep 1 |