updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / acpi-eeepc900 / suspend2ram.sh
blobdd710e24702aed3effd4a0d1384d6067a0fac83b
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 to avoid hangs on resume
13 # not included in this package because it's an experimental script
14 # eeeclockmod upclock
16 # flush the buffers to disk
17 sync
19 # change virtual terminal to not screw up X
20 chvt 6
22 # put us into suspend state
23 echo -n "mem" > /sys/power/state
25 # BEGIN WAKEUP SEQUENCE
27 #Ugly but effective way to restore screen
28 /usr/sbin/vbetool post
29 chvt 7 #Back to X
31 # restore backlight BRN
32 sleep 1
33 echo $BRN > /sys/class/backlight/eeepc/brightness
35 # choose right fsb, lcd backlight, devices power state accordingly to power source
36 # experimental script not included in this package
37 # /usr/local/bin/eeeautoclock.sh
40 exit 0