#!/bin/sh # if launched through a lid event and lid is open, do nothing echo "$1" | grep "button/lid" && grep -q open /proc/acpi/button/lid/LID/state && exit 0 # remove USB 1.1 driver /sbin/rmmod uhci_hcd # sync filesystem and clock sync /sbin/hwclock --systohc # switch to console FGCONSOLE=`fgconsole` chvt 6 #/usr/sbin/radeontool light off # go to hibernation /usr/sbin/hibernate -f # readjust the clock (it might be off a bit after suspend) /sbin/hwclock --adjust /sbin/hwclock --hctosys # reload USB 1.1 driver /sbin/modprobe uhci_hcd # turn on the backlight and switch back to X #radeontool light on chvt $FGCONSOLE