Date: Fri, 07 Jul 2000 00:00:39 +0900 From: Mitsuru IWASAKI <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 Message-ID: <20000707000039F.iwasaki@jp.FreeBSD.org> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000707000039F.iwasaki>