# -*- sh -*- # vim:ft=sh:ts=4:sw=4:noet # Written by dotCOMmie. Special thanks to eworm. # Based on DirkHusemann's kded script. # This script is debian centric but would be easy to modify for other distros # Requirments: # 915resolution (aptitude install 915resolution) # /etc/init.d/915resolution daemon start script # How it works: # On hibernate this switches to text console # On resume it restarts /etc/init.d/915resolution and switches to "gui" console # Installation: # Put script into your scriptlets.d dir (/etc/hibernate/scriptlets.d/) # add "EnableI915Hack 1" to suspend2.conf AddConfigHandler I915Options AddConfigHelp "EnableI915Hack " "Fixes the X restart on resume on machines with not-so-standard resolution (if you use 915resolution you need something like this)" I915Resume() { [ x"$I915_ENABLED" = "x1" ] || return 0 /etc/init.d/915resolution restart chvt 7 return 0 } I915Suspend(){ [ x"$I915_ENABLED" = "x1" ] || return 0 chvt 1 return 0 } I915Options() { case $1 in enablei915hack) BoolIsOn "$1" "$2" && I915_ENABLED=1 || return 0 ;; *) return 1 esac if [ -z "$I915_HOOKED" ] ; then AddSuspendHook 00 I915Suspend AddResumeHook 00 I915Resume I915_HOOKED=1 fi return 0 }