# /etc/acpi/events/sleepbtn event=button[ /]sleep action=/etc/acpi/sleepbtn.sh #!/bin/sh # /etc/acpi/sleepbtn.sh # Re-activates the screen when the lid is opened again VT_NR=$(mktemp -t sleep_btn.XXXXXXXX) # remember the current vt, then switch to text echo $(fgconsole) > $VT_NR chvt 1 # suspend echo disk > /sys/power/state # restore the VBIOS and vt /etc/init.d/915resolution restart chvt $(cat $VT_NR)