blob: 61598155f2a117f96f0ba1cd06dd1313f19b419f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#! /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"
${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"
then
x=0
while test "$x" != 4
do
bl 10
usleep 10
bl 50
usleep 10
let x=$x+1
done
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 ) &
|