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