From owner-freebsd-mobile Wed May 9 8:54:18 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from dargo.talarian.com (dargo.talarian.com [207.5.33.3]) by hub.freebsd.org (Postfix) with ESMTP id 48C8437B422 for ; Wed, 9 May 2001 08:54:16 -0700 (PDT) (envelope-from nsayer@quack.kfu.com) Received: from moya.talarian.com (moya.talarian.com [10.4.10.8]) by dargo.talarian.com (Postfix) with ESMTP id 9E13122B04 for ; Wed, 9 May 2001 08:51:22 -0700 (PDT) Received: from beast.talarian.com (beast.talarian.com [10.4.10.6]) by moya.talarian.com (Postfix) with ESMTP id 9A8D61A for ; Wed, 9 May 2001 08:54:14 -0700 (PDT) Received: from quack.kfu.com (localhost [127.0.0.1]) by beast.talarian.com (8.11.3/8.11.3) with ESMTP id f49FsE713312 for ; Wed, 9 May 2001 08:54:14 -0700 (PDT) (envelope-from nsayer@quack.kfu.com) Message-ID: <3AF96825.50803@quack.kfu.com> Date: Wed, 09 May 2001 08:54:13 -0700 From: Nick Sayer User-Agent: Mozilla/5.0 (X11; U; FreeBSD 4.3-RELEASE i386; en-US; 0.8.1) Gecko/20010411 X-Accept-Language: en MIME-Version: 1.0 To: freebsd-mobile@freebsd.org Subject: Recommended addition to apmd: Battery state watching Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org My vaio has one annoying quality: When it runs out of battery, it shuts off ungracefully. The Sony way of thinking is to do everything possible in Software. The lid switch on a vaio does nothing except turn off the backlight and flip a bit in the spic device. apm state for graceful suspend at end of battery is done in software, etc, etc, etc. KDE has support for apm state watching, but I think this would be a job better suited to apmd. I would propose adding the follwing syntax to apmd.conf: apm_batt ([0-9]+%|[0-9]+m) { ... } That is, as the battery state crosses from being above a given percentage or minutes remaining to below the same, then execute the given sequence. Obviously, this is only done if the machine is not on AC power. Some level of hysteris would also be used just in case. A prototypical usage would be apm_batt 5% { exec "logger -p kern.emerg *** Battery state low ***"; } apm_batt 2% { exec "logger -p kern.emerg *** Battery state critical -- suspending immediately ***"; exec "sleep 10"; exec "apm -Z"; } Anyone have any thoughts? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message