From owner-freebsd-mobile Thu Jul 6 8: 0:51 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id 50D0537B538 for ; Thu, 6 Jul 2000 08:00:48 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.10.1+3.3W/3.7W-tasogare/smtpfeed 1.07) with ESMTP id e66F0ip28852; Fri, 7 Jul 2000 00:00:44 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: jcm@FreeBSD-uk.eu.org Cc: iwasaki@jp.freebsd.org, mobile@freebsd.org, jsegovia@cnc.una.py Subject: Re: apm on toshiba 4010cdt In-Reply-To: <20000706154311.A9703@dogma.freebsd-uk.eu.org> References: <20000706134042.A9085@dogma.freebsd-uk.eu.org> <20000706230923G.iwasaki@jp.FreeBSD.org> <20000706154311.A9703@dogma.freebsd-uk.eu.org> X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000707000039F.iwasaki@jp.FreeBSD.org> Date: Fri, 07 Jul 2000 00:00:39 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 38 Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > apm_event POWERSTATECHANGE, CAPABILITIESCHANGE { > > exec "YOUR_SCRIPT_HERE"; > > } > > ok, here's my script so far: > > #!/bin/sh > /usr/sbin/apm -l > retval=$? I think this should be retval=`/usr/sbin/apm -l` # No? > if [ $retval -eq 10 ]; then and this one; if [ $retval -lt 10 ]; then would be better. > and all it does is show the battery level. i adjusted the '-eq 10' to '-eq > 255' just to test it, since i am using AC power now. but it still does the > same thing, and does not beep. I'm not sure if your bios can report POWERSTATECHANGE event or some, so you'd better to confirm it first (by putting logger line in your script for example or re-compile your kernel with options APM_DEBUG). #!/bin/sh logger -s 'APM status changed!' retval=`/usr/sbin/apm -l` if [ $retval -lt 10 ]; then /usr/local/bin/beep /usr/local/bin/beep /usr/local/bin/beep fi exit 0 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message