You are not logged in.
Hi,
I try to execute slock if the LID Button is pressed.
This is the lid-button part of my /etc/acpi/handler.sh script.
button/lid)
#echo "LID switched!">/dev/tty5
echo `date`:$* >> /acpi.log
DISPLAY=:0
xauth merge /home/michael/.Xauthority
/usr/bin/slock
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
I also tried "XAUTHORITY=/home/michael/.Xauthority" instead of "xauth merge /home/michael/.Xauthority" but it does not work.
There is a lid-button-event when I close the display. I checked it with the "echo `date`:$* >> /acpi.log" line.
Executing slock from a terminal (as root) works.
Last edited by SiD (2009-03-24 15:33:06)
Offline
tried
...
export DISPLAY=:0
xauth merge /home/michael/.Xauthority
...
and
...
export DISPLAY=:0
export XAUTHORITY=/home/michael/.Xauthority
...
but it still does not work.
Any ideas?
Offline
solved.
button/lid)
#echo "LID switched!">/dev/tty5
if [ `/bin/awk '{print $2}' /proc/acpi/button/lid/LID/state` == closed ]; then
DISPLAY=:0 su -c - michael /usr/bin/slock
fi
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
Offline