I have Ubuntu 12.10 installed on my ASUS G75VW which is connected to two external screen. I've set my settings in System settings > Power to Do nothing for AC and Suspend for DC. It has worked great until today after I installed XScreensaver. The problems start when I couldn't lock the computer (CTRL+ALT+L), and nothing happen when I choose Shutdown or Restart. After I've shutdown with the power button on the laptop and start again I got problems with the settings in Nvidia X Server, but I succeeded to solve that problem.
I uninstall XScreensaver and after that could I lock the computer and I thought that all problems where gone. When the computer ran in battery mode and I closed the lid should it go to sleep, but nothing happen. I know that the suspend function works because I have tested it.
Maybe I find the reason in /etc/acpi/lid.sh.
#!/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
. /usr/share/acpi-support/policy-funcs
. /etc/default/acpi-support
[ -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
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
What I want:
- Solve the problem so those settings I set with System settings > Power works correctly. Can I do any System Recovery (like in Windows)?
- If number 1 are too hard to make, I want to add code into lid.sh which go to sleep if the lid being closed and the computer run at battery.
Very grateful for help !!!