You are not logged in.

#1 2009-09-25 17:53:55

stefek
Member
Registered: 2009-04-14
Posts: 33

[SOLVED]Closed lid event

Hi!!
I've got Dell Studio 1555 laptop. I want it to react when I'm closing the lid. Now, there isn't any rule, when it works, but it works very very rarely. I've got acpi and acpid installed. ACPID daemon is working. I've tested:

tail -f /proc/acpi/button/lid/LID0/state

during closing/opening lid, but there has been only one line:

state:      open

Do I have to add any additional modules?
I really appreciate any help
stefek

Last edited by stefek (2009-09-26 13:51:51)

Offline

#2 2009-09-25 20:39:51

muunleit
Member
From: Germany
Registered: 2008-02-23
Posts: 234

Re: [SOLVED]Closed lid event

uncomment this line in /etc/acpi/handler.sh and look if anything is echoed on tty5 (ALT+CTR+F5)

echo "LID switched!">/dev/tty5

if yes, at a file in /etc/acpi/events/ containig something like

event=button[ /]lid
action=/path/to/your/program %e

"The mind can make a heaven out of hell or a hell out of heaven" -- John Milton

Offline

#3 2009-09-25 21:57:45

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: [SOLVED]Closed lid event

Here's what I've got in /etc/acpi/handler.sh:

    button/lid)
        # check if the lid is open or closed, using the /proc file
        grep -q closed /proc/acpi/button/lid/*/state
            if [ $? = 0 ]; then
                # if the lid is now closed, save the network state and suspend to ram
                /usr/bin/netcfg all-suspend
                /usr/sbin/pm-suspend
                #echo -n mem >/sys/power/state
            else
                # if the lid is now open, restore the network state
                /usr/bin/netcfg all-resume
            fi
        #echo "LID switched!">/dev/tty5
        ;;

thayer williams ~ cinderwick.ca

Offline

#4 2009-09-25 23:34:09

damjan
Member
Registered: 2006-05-30
Posts: 452

Re: [SOLVED]Closed lid event

stefek wrote:

I've tested:

tail -f /proc/acpi/button/lid/LID0/state

afaik, you can't do that since files in /proc are pseudo-files and get truncated and re-populated on each open.

use the ACPI events like eveyone said (you can use acpi_listen to see the ACPI events)

Offline

#5 2009-09-26 06:25:46

stefek
Member
Registered: 2009-04-14
Posts: 33

Re: [SOLVED]Closed lid event

I've also tested tail -f /var/log/acpid.log and the effect is the same. There is no reaction to closing lid. I've also uncommented  echo "LID switched!">/dev/tty5
and the TTY5 is always blank.

Offline

#6 2009-09-26 13:19:06

muunleit
Member
From: Germany
Registered: 2008-02-23
Posts: 234

Re: [SOLVED]Closed lid event

There is a post in a ubuntu-forum (link) which suggests to put 'noacpi' in the kernel-options in /boot/grub/menu.lst and closing the lid slowly.

Last edited by muunleit (2009-09-26 13:20:22)


"The mind can make a heaven out of hell or a hell out of heaven" -- John Milton

Offline

#7 2009-09-26 13:51:35

stefek
Member
Registered: 2009-04-14
Posts: 33

Re: [SOLVED]Closed lid event

Thanks, but i've added apic, not acpi ;-) and also brightness keys work!!

Offline

Board footer

Powered by FluxBB