Acustic 'empty battery warning' ?

François TOURDE fr-om at
Sat Dec 20 17:20:20 CET 2008

Le 14230ième jour après Epoch,
Lothar Behrens écrivait:

> Am 17.12.2008 um 13:16 schrieb Timo Juhani Lindfors:
>> Lothar Behrens <lothar.behrens at> writes:
>>> Is there a way to do this ?
>> while true; do
>>  if [ `capacity` -lt 10 ]; then
>>      alert
>>  fi
>>  sleep 120
>> done
> this is a starting point :-)

I've a small script that works as a daemon, checking interval depends
on the charge (described on a file), play sounds (except when
charging) depending on the current charge.

There is no doc, no install proc, it's not packaged, but it can be
done easily...

The config file (default values in the script) contains:

  # Les différents niveaux
  THRESHOLDS="100:20:1200: 20:10:600:low 10:5:150:critical 5:0:30:emergency"

Each group of check parms is max:min:delay:sound

If level is between (_max_,_min_), the "aplay" _sound_.wav and wait _delay_
for next check.

Hope it helps.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: init.d-batalarm
Type: text/x-sh
Size: 784 bytes
Desc: The init script
Url : 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: batalarm
Type: text/x-sh
Size: 1606 bytes
Desc: The daemon
Url : 

More information about the community mailing list