public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Gabor FLEISCHER <swsusp-XNofHPEhfVgNocND/f+tbZP2KDSNp7ea@public.gmane.org>
To: swsusp-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: jm-E0REtxwXDqY@public.gmane.org,
	ACPI-devel List
	<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: [Swsusp-devel] hibernate when battery is low ?
Date: Fri, 1 Aug 2003 10:31:08 +0200	[thread overview]
Message-ID: <20030801083108.GA11535@jcc.hu> (raw)
In-Reply-To: <200307312336.h6VNapI21536-D9AVUHqm8KsT64QOZzyjW+1ftBKYq+Ku@public.gmane.org>

On Thu, Jul 31, 2003 at 07:36:51PM -0400, Jan Merka <jm-E0REtxwXDqY@public.gmane.org> wrote:
> > ACPI_B=`acpi -b`
> > BAT=`echo "$ACPI_B" | sed -e "s/.*,\(.*\)%.*/\1/"`
> > CHARGE=`echo "$ACPI_B" | sed -e "s/.*:\([^,]*\),.*/\1/"`

> I will test it once I get to my developer box. I would recomend you to look 
> at wmab project. The source code might be an inspiration how to poll the 
> battery status.

I think you misunderstood something. This script goes to the place where
acpid calls it. I'm not polling anything, 'cause I get called when needed.
The only thing I do is reading the battery status. But to do this I use the
acpi program, which is included in the debian, and hopefully updated, so
that if there's any change in /proc/acpi, I won't have to know about it,
because `acpi -b` will give me the same output.

The another thing is, that it's true that I think most WMs have some kind of
APM/ACPI daemon. Unfortunatelly they probably are reading the relevant
status informations in every X second. The ideal would be if they could
register themselves to acpid as a callback function for Y event. This way
they could also set the behaviour of acpid. Currently I don't really know
what's happening: battery is getting down. Depending on how acpid,
klaptopdaemon (or another WM's daemon) is set maybe acpid will call
hibernate, maybe the WM's daemon...

But let's continue this on acpi-dev list!

Gavriel


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01

           reply	other threads:[~2003-08-01  8:31 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200307312336.h6VNapI21536-D9AVUHqm8KsT64QOZzyjW+1ftBKYq+Ku@public.gmane.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030801083108.GA11535@jcc.hu \
    --to=swsusp-xnofhpehfvgnocnd/f+tbzp2kdsnp7ea@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=jm-E0REtxwXDqY@public.gmane.org \
    --cc=swsusp-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox