3 source /etc
/conf.d
/acpi-eeepc-generic.conf
4 source /etc
/acpi
/eeepc
/acpi-eeepc-generic-functions.sh
6 function suspend_check_blacklisted_processes
() {
9 logger
"Checking for processes before suspending: $processes ($p_num)"
10 for ((i
=0;i
<${p_num};i
++)); do
13 logger
"process #$i: $p ($pid)"
14 echo "process #$i: $p ($pid)"
16 echo "$p is running! Canceling suspend" &&
17 logger
"$p is running! Canceling suspend" &&
22 suspend_check_blacklisted_processes
"${SUSPEND_BLACKLISTED_PROCESSES[@]}"
24 if [ -e "${EEEPC_VAR}/power.lock" ]; then
25 logger
"${EEEPC_VAR}/power.lock exist, canceling suspend"
29 vga_is_on
=`xrandr | grep -A 1 VGA | grep "*"`
30 if [ "x$vga_is_on" != "x" ]; then
31 logger
"VGA is up and running, canceling suspend"
35 if grep -q mem
/sys
/power
/state
; then
37 # BEGIN SUSPEND SEQUENCE
39 logger
"Start suspend sequence"
42 CONSOLE_NUMBER
=$
(fgconsole
)
43 logger
"Saving console number: $CONSOLE_NUMBER"
45 # save the brightness value
46 BRN
=`cat /sys/class/backlight/eeepc/actual_brightness`
47 logger
"Saving brightness value: $BRN"
49 # save the FSB value and go to powersaver mode
50 # /etc/acpi/eee/fsb.sh autosuspend
51 logger
"Save the FSB value and go to powersaver mode: DISABLE"
55 EEESTATE
=$
(lsmod |
grep eee |
awk {'print $1'})
56 if [ "X$EEESTATE" == "Xeee" ];
60 logger
"Unloading eee module";
63 # flush the buffers to disk
66 # change virtual terminal to not screw up X
69 # put us into suspend state
70 echo -n "mem" > /sys
/power
/state
72 logger
"BEGIN WAKEUP SEQUENCE..."
74 #Ugly but effective way to restore screen
75 #/usr/sbin/vbetool post
78 # restore backlight BRN
80 echo $BRN > /sys
/class
/backlight
/eeepc
/brightness
81 logger
"Restoring brightness"
83 # # restore the FSB value
84 # /etc/acpi/eee/fsb.sh autoresume