#! /bin/sh # Modified version of function from swsusp2 script "hibernate". # by William Stein # GPL, etc. 2004. SWSUSP_LEAVE_X_BEFORE_SUSPEND="nvidia" VERBOSE="/tmp/verbose" SwitchToX() { if [ "$SWSUSP_LEAVE_X_BEFORE_SUSPEND" = "nvidia" ]; then export XAUTHORITY=/tmp/.Xauthority-swsusp-fake-x-server export HOME=/dev/shm xauth 2> $VERBOSE 1> $VERBOSE < $VERBOSE 1> $VERBOSE fi xauth 2> $VERBOSE 1> $VERBOSE < $VERBOSE # if fgconsole is available, the original VT will be stored in this var if [ "$ORIGINAL_VT" != "" ]; then chvt "$ORIGINAL_VT" else echo "Original virtual terminal not memorized (trying 7)" chvt 7 fi return $? } SwitchToX