I created a file /etc/acpi/lidscreenblank.sh containing the following code:
#!/bin/bash
. /etc/default/acpi-support
. /usr/share/acpi-support/power-funcs
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
fi
then I made that file executable.
edited /etc/acpi/events/lidbtn
and changed
action=/etc/acpi/lid.sh
to
action=/etc/acpi/lidscreenblank.sh
then restarted acpi: sudo /etc/init.d/acpid restart
and voila! it works. I know its missing some of the screensaver handling that lid.sh was doing, but I dont really use screensavers anyways, so i guess i dont cante about that.
No comments:
Post a Comment