public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* lid state?
@ 2002-10-06  5:13 John Belmonte
  2002-10-07 12:10 ` Derek Broughton
  0 siblings, 1 reply; 5+ messages in thread
From: John Belmonte @ 2002-10-06  5:13 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hello,

What is the correct way to detect the lid state on a lid event?  I've 
seen some mention of using a counter, but as the lid could be closed 
before acpid starts up, it doesn't seem very robust.


-John



-- 
http:// i      .   /



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: lid state?
  2002-10-06  5:13 lid state? John Belmonte
@ 2002-10-07 12:10 ` Derek Broughton
       [not found]   ` <OE13CngokVNTmgEVg3U0000c5a1-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Derek Broughton @ 2002-10-07 12:10 UTC (permalink / raw)
  To: ACPI Development - Sourceforge

From: "John Belmonte" <jvb-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>
>
> What is the correct way to detect the lid state on a lid event?  I've
> seen some mention of using a counter, but as the lid could be closed
> before acpid starts up, it doesn't seem very robust.

It's far from ideal, but it's robust enough, because the lid state bears no
connection to acpid.  Whether or not acpid is running, events get generated.
I suppose, conceivably, the lid could be closed when the system boots and
ACPI starts - but how realistic is that?  I can't see it happening on my
system.
--
derek


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: lid state?
       [not found]   ` <OE13CngokVNTmgEVg3U0000c5a1-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
@ 2002-10-07 14:11     ` Martijn van de Streek
  2002-10-07 14:22     ` Frank Mehnert
  1 sibling, 0 replies; 5+ messages in thread
From: Martijn van de Streek @ 2002-10-07 14:11 UTC (permalink / raw)
  To: Derek Broughton; +Cc: ACPI Development - Sourceforge

On Mon, 07 Oct 2002, Derek Broughton wrote:

> It's far from ideal, but it's robust enough, because the lid state bears no
> connection to acpid.  Whether or not acpid is running, events get generated.
> I suppose, conceivably, the lid could be closed when the system boots and
> ACPI starts - but how realistic is that?  I can't see it happening on my
> system.

It's very well possible to do that. And it breaks any on/off type script
you set up for the lid button.

I'd like separate open and close messages as well actually..

Martijn
-- 
You may be infinitely smaller than some things, but you're infinitely 
larger than others.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: lid state?
       [not found]   ` <OE13CngokVNTmgEVg3U0000c5a1-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
  2002-10-07 14:11     ` Martijn van de Streek
@ 2002-10-07 14:22     ` Frank Mehnert
       [not found]       ` <E17yYmP-0004wp-00-Hkr6DilkjYZTIIw02KIYYwp9XTrnmqkB@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Frank Mehnert @ 2002-10-07 14:22 UTC (permalink / raw)
  To: ACPI Development - Sourceforge

On Monday 07 October 2002 14:10, Derek Broughton wrote:
> From: "John Belmonte" <jvb-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>
>
> > What is the correct way to detect the lid state on a lid event?  I've
> > seen some mention of using a counter, but as the lid could be closed
> > before acpid starts up, it doesn't seem very robust.
>
> It's far from ideal, but it's robust enough, because the lid state bears no
> connection to acpid.  Whether or not acpid is running, events get
> generated. I suppose, conceivably, the lid could be closed when the system
> boots and ACPI starts - but how realistic is that?  I can't see it
> happening on my system.

Very realistic if you have attached an external monitor to your notebook.

Frank
-- 
Frank Mehnert
## Dept. of Computer Science, Dresden University of Technology, Germany ##
## E-Mail: fm3-IG//nw+yl+iQIjdd1DhZXWfrygkm6VTR@public.gmane.org    http://os.inf.tu-dresden.de/~fm3 ##


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: lid state?
       [not found]       ` <E17yYmP-0004wp-00-Hkr6DilkjYZTIIw02KIYYwp9XTrnmqkB@public.gmane.org>
@ 2002-10-07 18:15         ` James D Strandboge
  0 siblings, 0 replies; 5+ messages in thread
From: James D Strandboge @ 2002-10-07 18:15 UTC (permalink / raw)
  To: ACPI Development - Sourceforge

On Mon, 2002-10-07 at 10:22, Frank Mehnert wrote:
> On Monday 07 October 2002 14:10, Derek Broughton wrote:
> > From: "John Belmonte" <jvb-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>
> >
> > > What is the correct way to detect the lid state on a lid event?  I've
> > > seen some mention of using a counter, but as the lid could be closed
> > > before acpid starts up, it doesn't seem very robust.
> >
> > It's far from ideal, but it's robust enough, because the lid state bears no
> > connection to acpid.  Whether or not acpid is running, events get
> > generated. I suppose, conceivably, the lid could be closed when the system
> > boots and ACPI starts - but how realistic is that?  I can't see it
> > happening on my system.
> 
> Very realistic if you have attached an external monitor to your notebook.
> 
This would be nice, but as a workaround/solution, I use touch in my
lid.sh script.  Eg:

#!/bin/sh
CLOSEDFILE="/var/run/acpi_lid_closed"

case "$2" in
    LID)
        case "$3" in
            00000080)
                if [ -e "$CLOSEDFILE" ];
                then
                        logger -p daemon.info "ACPI lid: lid is open"
                        rm -f $CLOSEDFILE
                else
                        logger -p daemon.info "ACPI lid: lid is closed"
                        touch $CLOSEDFILE
                fi
                ;;                      
            *)
                logger -p daemon.info "ACPI lid: unknown event $3 (in
$@)"
                ;;
        esac
        ;;
    *)
        logger -p daemon.info "ACPI lid: unknown event $2 (in $@)"
        ;;
esac



Since (on my system) /var/run is cleaned out on boot, this works fine. 
Of course, if the lid is closed when the machine comes on, this is
backwards, but I can't turn my laptop on when the lid is closed, so no
big deal for me.  The script could also check if an external monitor was
connected, etc to make sure that it works in whatever situation.

Jamie Strandboge



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-07 18:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-06  5:13 lid state? John Belmonte
2002-10-07 12:10 ` Derek Broughton
     [not found]   ` <OE13CngokVNTmgEVg3U0000c5a1-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
2002-10-07 14:11     ` Martijn van de Streek
2002-10-07 14:22     ` Frank Mehnert
     [not found]       ` <E17yYmP-0004wp-00-Hkr6DilkjYZTIIw02KIYYwp9XTrnmqkB@public.gmane.org>
2002-10-07 18:15         ` James D Strandboge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox