You are not logged in.

#1 2009-01-09 14:34:44

gofree
Member
From: Slovakia
Registered: 2008-07-26
Posts: 51

Turn off monitor on lid close doesn't work after first reboot

On a fresh installation ( running daemons hal fam alsa gdm bluetooth cups and others present after fresh install ) it worked perfectly. I was so happy, cause this is the last issue Im having. I've tried other distros and winXP but always got back to arch big_smile Hardware HP6720s - 1GB RAM, X3100 ( looking forward to 2.6.28 and new intel drivers ). Installed software kernel 2.6.27, gnome, gnome-power-manager. The only thing that confuses me that it worked great till first reboot. Any sugesstions?

Offline

#2 2009-01-09 14:55:52

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Turn off monitor on lid close doesn't work after first reboot

You need to provide more information. How does your lid handler look like, does it start working if you restart acpid... take a look at this (now closed) bug report: http://bugs.archlinux.org/task/7593


You need to install an RTFM interface.

Offline

#3 2009-01-09 16:21:17

gofree
Member
From: Slovakia
Registered: 2008-07-26
Posts: 51

Re: Turn off monitor on lid close doesn't work after first reboot

/etc/acpi/handler.sh

#!/bin/sh
# Default acpi script that takes an entry for all actions

# NOTE: This is a 2.6-centric script.  If you use 2.4.x, you'll have to
#       modify it to not use /sys

minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"

set $*

case "$1" in
    button/power)
        #echo "PowerButton pressed!">/dev/tty5
        case "$2" in
            PWRF)   logger "PowerButton pressed: $2" ;;
            *)      logger "ACPI action undefined: $2" ;;
        esac
        ;;
    button/sleep)
        case "$2" in
            SLPB)   echo -n mem >/sys/power/state ;;
            *)      logger "ACPI action undefined: $2" ;;
        esac
        ;;
    ac_adapter)
        case "$2" in
            AC)
                case "$4" in
                    00000000)
                        echo -n $minspeed >$setspeed
                        #/etc/laptop-mode/laptop-mode start
                    ;;
                    00000001)
                        echo -n $maxspeed >$setspeed
                        #/etc/laptop-mode/laptop-mode stop
                    ;;
                esac
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    battery)
        case "$2" in
            BAT0)
                case "$4" in
                    00000000)   #echo "offline" >/dev/tty5
                    ;;
                    00000001)   #echo "online"  >/dev/tty5
                    ;;
                esac
                ;;
            CPU0)    
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    button/lid)
        #echo "LID switched!">/dev/tty5
        sh /etc/acpi/actions/lm_lid.sh
        ;;
    *)
        logger "ACPI group/action undefined: $1 / $2"
        ;;
esac

/etc/acpi/actions/lm_lid.sh

/usr/bin/xset -display :0.0 dpms force off

Offline

#4 2009-01-09 17:52:10

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Turn off monitor on lid close doesn't work after first reboot

So, you don't have the if clause (btw once you fix this you might consider adding it, because your screen would go off when opening the lid too with the current setup).
You can edit /etc/rc.d/acpid to add "-l" to acpid starting line for verbose logging (which was default before 1.0.8, but now has to be enabled). Doing that or not, did you monitor your acpid log file (tail -f /var/log/acpid.log) while switching the lid? Does it capture the LID event? Does it call the appropriate handler? Do you have acpi modules loaded (button in particular)?


You need to install an RTFM interface.

Offline

#5 2009-01-20 17:53:54

b4d
Member
From: Slovenia
Registered: 2008-07-06
Posts: 62
Website

Re: Turn off monitor on lid close doesn't work after first reboot

Almost the same thing here, turning off the lid does not work after boot, I have to manually restart acpid to make it work.

/etc/acpi/actions/lm_lid.sh

#! /bin/sh

test -f /usr/sbin/laptop_mode || exit 0
# lid button pressed/released event handler

/usr/sbin/laptop_mode auto

if grep -q open /proc/acpi/button/lid/LID/state
then
    XAUTHORITY=$XAUTHORITY /usr/bin/xset -display :0.0 dpms force on

else
    XAUTHORITY=$XAUTHORITY /usr/bin/xset -display :0.0 dpms force off;
    alock -auth sha1:hash=xxxxxxxxxxxxxxxxxxxxxxxxxxxx -bg blank:black
fi

Offline

#6 2009-01-20 19:21:27

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Turn off monitor on lid close doesn't work after first reboot

This should do it:
XAUTHORITY=/home/b4d/.Xauthority /some/command


You need to install an RTFM interface.

Offline

#7 2009-01-21 15:28:35

b4d
Member
From: Slovenia
Registered: 2008-07-06
Posts: 62
Website

Re: Turn off monitor on lid close doesn't work after first reboot

Okay, after try'n'fail and anrxc's help it now finally works, screen goes off and it locks with alock.

#! /bin/sh

test -f /usr/sbin/laptop_mode || exit 0
# lid button pressed/released event handler

/usr/sbin/laptop_mode auto

if grep -q open /proc/acpi/button/lid/LID/state
then
    XAUTHORITY=/home/b4d/.Xauthority /usr/bin/xset -display :0.0 dpms force on

else
    XAUTHORITY=/home/b4d/.Xauthority /usr/bin/xset -display :0.0 dpms force off ;
    XAUTHORITY=/home/b4d/.Xauthority DISPLAY=:0.0 /usr/bin/sudo -u b4d alock -auth sha1:hash=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -bg blank:black
fi

Offline

Board footer

Powered by FluxBB