#! /bin/sh su - phd -c "xscreensaver-command -exit" # switch to virtual terminal 2 to avoid graphics corruption in X curcons=`fgconsole` chvt 2 clear # synchronize system clock with hardware hwclock --directisa --localtime --systohc # write all unwritten data (just in case) sync # suspend s2ram -fs -a1 # synchronize hardware clock with system hwclock --directisa --localtime --hctosys # switch back to the original virtual terminal chvt $[curcons%6+1] chvt $curcons cd "$HOME" su - phd -c "xscreensaver &" clear