UPDATED:

Some recent update to the hotplug/udev subsystem has broken the touchpad on resume. To counter this, I have added some lines to the script below, to switch away to a text console, and then back again. This causes the touchpad to be reset into a working state on resume. The script now also does a vbetool post to restore the console text mode on resume.

Standby button on Dell Inspiron 9300:

To enable the blue Fn-ESC "StandBy" key, create this /etc/acpi/events/i9300_sleep file:

# 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!