# Dell Inspiron 9300 event=button[ /]sleep action=/usr/local/bin/suspend |
Now install this /usr/local/bin/suspend script:
#!/bin/sh # determine current console number: currentvt=`/bin/fgconsole` # switch away from X11, to avoid touchpad lockup on resume if [ ! "$currentvt" = "12" ]; then /usr/bin/chvt 12 fi # go into standby sync; sync echo -n mem >/sys/power/state # emerge from standby on resume # reinitialize video to get text console working again on resume vbetool post # switch back to original console/X11 screen if [ ! "$currentvt" = "12" ]; then /usr/bin/chvt $currentvt fi |
Also, prevent the normal (K)Ubuntu script from interfering. This requires that you edit /etc/acpi/events/sleepbtn and comment-out everything, so that it ends up like this:
# /etc/acpi/events/sleepbtn # Called when the user presses the sleep button #event=button[ /]sleep #action=/etc/acpi/sleep.sh |
After making those changes, restart acpid:
/etc/init.d/acpid restart
All done!