grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
then
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
. /usr/share/acpi-support/screenblank
fi
done
else
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
grep -q off-line /proc/acpi/ac_adapter/*/state
if [ $? = 1 ]
then
if pidof xscreensaver > /dev/null; then
su $user -c "xscreensaver-command -unthrottle"
fi
fi
if [ x$RADEON_LIGHT = xtrue ]; then
[ -x /usr/sbin/radeontool ] && radeontool light on
fi
if [ `pidof xscreensaver` ]; then
su $user -c "xscreensaver-command -deactivate"
fi
su $user -c "xset dpms force on"
fi
done
fi
[ -x /etc/acpi/local/lid.sh.post ] && /etc/acpi/local/lid.sh.post
I have reinstalled 11.04 where suspend works fine. I looked at lid.sh and there is no sign of pm-suspend either
#!/bin/bash
# TODO: Change the above to /bin/sh
test -f /usr/share/ acpi-support/ state-funcs || exit 0
. /usr/share/ acpi-support/ power-funcs acpi-support/ policy- funcs acpi-support
. /usr/share/
. /etc/default/
[ -x /etc/acpi/ local/lid. sh.pre ] && /etc/acpi/ local/lid. sh.pre
if [ `CheckPolicy` = 0 ]; then exit; fi
grep -q closed /proc/acpi/ button/ lid/*/state .X11-unix/ X##` ":$displaynum" acpi-support/ screenblank .X11-unix/ X##` ":$displaynum" ac_adapter/ */state command -unthrottle" radeontool ] && radeontool light on command -deactivate" local/lid. sh.post ] && /etc/acpi/ local/lid. sh.post
if [ $? = 0 ]
then
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=
. /usr/share/
fi
done
else
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=
grep -q off-line /proc/acpi/
if [ $? = 1 ]
then
if pidof xscreensaver > /dev/null; then
su $user -c "xscreensaver-
fi
fi
if [ x$RADEON_LIGHT = xtrue ]; then
[ -x /usr/sbin/
fi
if [ `pidof xscreensaver` ]; then
su $user -c "xscreensaver-
fi
su $user -c "xset dpms force on"
fi
done
fi
[ -x /etc/acpi/