You are not logged in.

#1 2009-03-20 11:21:14

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

[solved] running slock from /etc/acpi/handler.sh does not work

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

#2 2009-03-21 15:18:29

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: [solved] running slock from /etc/acpi/handler.sh does not work

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

#3 2009-03-24 15:32:28

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: [solved] running slock from /etc/acpi/handler.sh does not work

solved. smile

    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

Board footer

Powered by FluxBB