From owner-freebsd-current@FreeBSD.ORG Fri Jul 20 09:33:18 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A70F2106566C for ; Fri, 20 Jul 2012 09:33:18 +0000 (UTC) (envelope-from ftp51246-2575596@sh4-5.1blu.de) Received: from sh4-5.1blu.de (sh4-5.1blu.de [213.83.63.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6065E8FC08 for ; Fri, 20 Jul 2012 09:33:18 +0000 (UTC) Received: from ftp51246-2575596 by sh4-5.1blu.de with local (Exim 4.69) (envelope-from ) id 1Ss9HY-0008O3-K1; Fri, 20 Jul 2012 11:13:57 +0200 Date: Fri, 20 Jul 2012 11:13:56 +0200 From: Matthias Apitz To: Erich Dollansky Message-ID: <20120720091356.GA31015@sh4-5.1blu.de> References: <201207201004.59451.erichfreebsdlist@ovitrap.com> <20120720053108.GD70259@e-new.0x20.net> <201207201545.23915.erichfreebsdlist@ovitrap.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201207201545.23915.erichfreebsdlist@ovitrap.com> X-Operating-System: FreeBSD 7.0-RELEASE (i386) User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Cc: freebsd-current@freebsd.org, Lars Engels Subject: Re: Script to monitor battery status on X220 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2012 09:33:18 -0000 El día Friday, July 20, 2012 a las 03:45:23PM +0700, Erich Dollansky escribió: > > ... > > Is it necessary to poll? Usually devd generates an event when the > > battery status and/or percentage changes. Just read the events from > > /var/run/devd.pipe. > > > this is a good idea. I did not like this solution either but did not get a better idea when I did it. I wrote and used something similar for my netbook EeePC 900; it turned out that the battery is not showing the remaining capacity in a linear way; the last 5% are 'consumed' in a few seconds, i.e. below 20% I polled every 2 seconds; matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.unixarea.de/