From owner-freebsd-mobile@FreeBSD.ORG Tue Mar 8 23:07:27 2005 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6D2A916A4CE; Tue, 8 Mar 2005 23:07:27 +0000 (GMT) Received: from hawk.dcu.ie (mail.dcu.ie [136.206.1.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F96043D49; Tue, 8 Mar 2005 23:07:26 +0000 (GMT) (envelope-from svan@redbrick.dcu.ie) Received: from deathray.redbrick.dcu.ie (136.206.15.3) by hawk.dcu.ie (7.0.016) id 41108D1900CF519F; Tue, 8 Mar 2005 23:07:26 +0000 Received: from carbon.redbrick.dcu.ie ([2001:770:107:15:206:5bff:fefc:fb70] ident=mail) by deathray.redbrick.dcu.ie with esmtp (Exim 4.31) id 1D8noB-0008PG-Mo; Tue, 08 Mar 2005 23:08:11 +0000 Received: from svan by carbon.redbrick.dcu.ie with local (Exim 3.35 #1 (Debian)) id 1D8nnc-0001ub-00; Tue, 08 Mar 2005 23:07:36 +0000 Date: Tue, 8 Mar 2005 23:07:36 +0000 From: Sarunas Vancevicius To: Josef Karthauser Message-ID: <20050308230736.GA5040@carbon.redbrick.dcu.ie> References: <20050305192153.GA20692@genius.tao.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050305192153.GA20692@genius.tao.org.uk> User-Agent: Mutt/1.5.8i cc: mobile@freebsd.org Subject: Re: Out of battery indicator. X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2005 23:07:27 -0000 On 19:21, Sat 05 Mar 05, Josef Karthauser wrote: > Does anyone have a solution to running out of battery using ACPI (5.3?). > I keep forgetting to plug in my power supply and the machine dies rather > suddenly without beeping or giving me any warning that it was out of > battery. > > Any ideas? I would have thought that this was an O/S task rather than a > third party app task. > > Joe Hi All, For rather complex solution: # kldload speaker # chmod 660 /dev/speaker Checkout source code for battd utility in DragonFly (http://dragonflybsd.org/cvsweb/src/usr.sbin/battd/). Compile, install and run it with something like: $ battd -p 10 -e $HOME/bin/beep_speaker And where $HOME/bin/beep_speaker: #/bin/sh TUNE="l2b.f+.p16a.c+.p l4mne8a2mspg+e8c+f+8b2" /bin/echo $TUNE > /dev/speaker Which will play "opening bars of the theme from Star Trek Classic" when the battery will reach approximately 10%. There are more tunes in src/usr.sbin/spkrtest/spkrtest.sh, and you can always make your own ;-). A long string of 'A's will produce unpleasant beeping, which will remind you to turn on turn on your power supply :-). HTH. Sarunas