updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / acpi-eeepc900 / suspend2ram.sh~
blobecadf4113bf762435dfd87941ac187f3e3345844
1 #!/bin/sh
2 if [ -e "/etc/acpi/power.lock" ]; then
3 exit 0
4 fi
6 if grep -q mem /sys/power/state ; then
8 # BEGIN SUSPEND SEQUENCE
9 # save the brightness value
10 BRN=$(cat /sys/class/backlight/eeepc/actual_brightness)
12 # set the fsb to its normal speed
13 # eeeclockmod upclock
15 # flush the buffers to disk
16 sync
18 # change virtual terminal to not screw up X
19 chvt 6
21 # put us into suspend state
22 echo -n "mem" > /sys/power/state
24 # BEGIN WAKEUP SEQUENCE
26 #Ugly but effective way to restore screen
27 /usr/sbin/vbetool post
28 chvt 7 #Back to X
30 # restore backlight BRN
31 sleep 1
32 echo $BRN > /sys/class/backlight/eeepc/brightness
34 # choose right fsb, lcd backlight, devices power state accordingly to power source
35 #/usr/local/bin/eeeautoclock.sh &
38 exit 0