updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / acpi-eee904 / suspend2ram.sh
blobf414a66ab85379bd9fe0d8bdd4b57a3bb66955ad
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 /proc/acpi/asus/brn)
12 # flush the buffers to disk
13 sync
15 # change virtual terminal to not screw up X
16 chvt 6
18 # put us into suspend state
19 echo -n "mem" > /sys/power/state
21 # BEGIN WAKEUP SEQUENCE
23 #Ugly but effective way to restore screen
24 /usr/sbin/vbetool post
25 chvt 7 #Back to X
27 # restore backlight BRN
28 sleep 1
29 echo $BRN > /proc/acpi/asus/brn
32 exit 0