updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / acpi-eee / suspend2ram.sh
blobd0404f78f706ddafec50ac668f364ba5ff88dbd0
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
31 # execute powersource.sh so we have the right settings after suspend
32 (sleep 1; /etc/acpi/powersource.sh &) &
35 exit 0