Re: [ACPI-sppt] acpi power event

Jack Coates <[email protected]>
Newsgroups gmane.linux.acpi.support
Organization Monkeynoodle.Org
Message-ID <[email protected]>
On Thu, 2003-06-12 at 07:01, Derek Broughton wrote:
> From: "Jack Coates" <[email protected]>
> 
> > /etc/acpi/events/power :
> > # change screen brightness and CPU speed
> > event=ac_adapter.*
> > action=/etc/acpi/actions/powerchange
> >
> >
> > /etc/acpi/actions/powerchange
> > #!/bin/sh
> > status=`sed "s/state: *//" /proc/acpi/ac_adapter/ACAD/state`
> > case $status in
> >         "on-line"       )       /usr/bin/spicctrl -b 255
> >                                 exit 0
> >                                 ;;
> >         "off-line"      )       /usr/bin/spicctrl -b 100
> >                                 exit 0
> >                                 ;;
> >         esac
> > echo "Something bad happened!"
> > exit 1
> >
> > The power button > halt-dialog thing works nicely. If I run
> > /etc/acpi/actions/powerchange manually, it works properly. But it
> > doesn't catch the event on a regular basis. Is there a typo in
> > /etc/acpi/events/power that I'm just not seeing?
> >
> I'm not sure I understand your problem.  What's spicctrl do?  Are you saying
> that if you unplug power, instead of running powerchange it runs default.sh
> (which would probably produce messages like that)?  If so, you must be defining
> some other event that invokes default.sh before this one that invokes
> powerchange (it certainly looks as though this rule should invoke powerchange).
> 
> derek

Sorry -- the problem is that ACPI ac_adapter events aren't triggering
the script.

spicctrl adjusts screen brightness on my laptop. Idea is to decrease
brightness when using battery.

I don't have an /etc/acpi/default.sh at all, and nothing in
/etc/acpi/events is calling it anymore... Here's a question though. How
are events matched? Do the file names in /etc/acpi/events matter at all?
Would a single match file make more sense than separate battery, button
& power files? That would make it easier to specify a fall-through
action (logger "handler for event foobar not defined").

thanks,
-- 
Jack Coates
Monkeynoodle: A Scientific Venture...
http://www.monkeynoodle.org/resume.html



-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.