Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how make my laptop beep when low battery?

115 views
Skip to first unread message

paragasu

unread,
Mar 27, 2009, 1:40:09 AM3/27/09
to
I am using ACPI debian testing with linux kernel 2.6.26-1-686, the
problem is, there is no warning when the battery is low.

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

Andrei Popescu

unread,
Mar 27, 2009, 5:30:19 AM3/27/09
to
On Thu,26.Mar.09, 22:38:05, paragasu wrote:
> I am using ACPI debian testing with linux kernel 2.6.26-1-686, the
> problem is, there is no warning when the battery is low.
>
> Is there a way to make a warning beep whenever my laptop battery low?

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)

signature.asc

paragasu

unread,
Mar 27, 2009, 8:00:25 AM3/27/09
to
i am using openbox , btw, how to do it in KDE? maybe the same can be
done on openbox?

Andrei Popescu

unread,
Mar 27, 2009, 6:10:21 PM3/27/09
to
[top posting fixed]

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.

signature.asc

Michael Pobega

unread,
Mar 28, 2009, 11:50:12 AM3/28/09
to
On Fri, Mar 27, 2009 at 04:52:52AM -0700, paragasu wrote:
> i am using openbox , btw, how to do it in KDE? maybe the same can be
> done on openbox?
>

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

Ken Irving

unread,
Mar 28, 2009, 1:30:20 PM3/28/09
to
On Thu, Mar 26, 2009 at 10:38:05PM -0700, paragasu wrote:
> I am using ACPI debian testing with linux kernel 2.6.26-1-686, the
> problem is, there is no warning when the battery is low.
>
> Is there a way to make a warning beep whenever my laptop battery low?

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

0 new messages