Quantcast

how make my laptop beep when low battery?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how make my laptop beep when low battery?

paragasu
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 [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how make my laptop beep when low battery?

Andrei Popescu-3
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 (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how make my laptop beep when low battery?

paragasu
i am using openbox , btw, how to do it in KDE? maybe the same can be
done on openbox?

On 3/27/09, Andrei Popescu <[hidden email]> wrote:

> 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)
>


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how make my laptop beep when low battery?

Andrei Popescu-3
[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.

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how make my laptop beep when low battery?

Michael Pobega
In reply to this post by paragasu
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


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how make my laptop beep when low battery?

Ken Irving
In reply to this post by paragasu
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


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Loading...