#!/bin/sh
if grep -q closed /proc/acpi/button/lid/LID0/state
then
	/usr/local/bin/xrun.sh /usr/local/bin/backlit.sh status
	if [ $? -eq 0 ]
	then
		echo sleep
		/usr/sbin/pm-suspend
	fi
fi
