Is there a way to make a warning beep whenever my laptop battery low?
thank you
--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Yes, but this is usually done by some user tool. What Desktop
Environment are you using? (I can help with Xfce, but am not familiar
with KDE or Gnome)
Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)
On Fri,27.Mar.09, 04:52:52, paragasu wrote:
> > Yes, but this is usually done by some user tool. What Desktop
> > Environment are you using? (I can help with Xfce, but am not familiar
> > with KDE or Gnome)
> i am using openbox , btw, how to do it in KDE? maybe the same can be
> done on openbox?
AFAICT it is done via kpowersave, but I'm not sure it will work if you
don't use KDE. Maybe something like wmbattery might help.
I know a guy who did it using KPowerSave, I think he set up the rules
and then let it run as a daemon. I'm not 100% sure though, so I'll have
to ask him when I get back to campus.
--
http://pobega.wordpress.com
http://identica/pobega
On my system data on the battery state is available under /proc/acpi/,
e.g.,
$ cat /proc/acpi/battery/BAT1/info
present: yes
design capacity: 4000 mAh
last full capacity: 4000 mAh
battery technology: rechargeable
design voltage: 14800 mV
design capacity warning: 420 mAh
design capacity low: 156 mAh
capacity granularity 1: 264 mAh
capacity granularity 2: 3780 mAh
model number: PA3206U
serial number: 3658Q
battery type: Li-Ion
OEM info: COMPAL
and,
$ cat /proc/acpi/battery/BAT1/state
present: yes
capacity state: ok
charging state: discharging
present rate: 0 mA
remaining capacity: 3960 mAh
present voltage: 16277 mV
Here's an attempt at a script to use the remaining capacity as
an "alarm", with an arbitrary setpoint:
#!bin/sh
SETPOINT=1000
awk -vSP=$SETPOINT '/capacity/ && $3<SP{print "beep"}' \
/proc/acpi/battery/BAT1/state
The action here is just to print "beep", so replace that with something
that makes a sound. The beep package provides /usr/bin/beep, which can
beep at selected frequency and duration, e.g:
awk -vSP=$SETPOINT '/capacity/ && $3<SP{system("/usr/bin/beep")}' \
/proc/acpi/battery/BAT1/state
If you figure out the right proc file to use, choose a setpoint,
aptitude install beep, and put this in your crontab to run every
minute or so, maybe it'll do what you want.
Good luck!
Ken
--
Ken Irving