NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

How does one set "user-capacity" for the battery?

Hi all

Man powerd(8) lines 126ff say that there is an event the battery sensor:
"user-capacity       Capacity dropped below the limit set by the user. ..."

For instance, when on a train ride and no power-sockets at hand, I would
like my laptop to go into sleep mode, should the capacity drop below
a certain level.  And thus my work is saved until I find a power socket.

Some basic information:

The system is NetBSD 5.1 AMD/64 GENERIC.

My battery is a SONY, Lion, AS09A41 0030.  The command "envstat -d acpibat0"
                       Current  CritMax  CritMin  CritCap     Unit
[ 0]       present:         ON
[ 1]    design cap:      4.400                                  Ah
[ 2] last full cap:      3.940                                  Ah
[ 3]    technology:          1
[ 4]design voltage:     11.100                                   V
[ 5]      warn cap:      0.220                                  Ah  ( 5.58%)
[ 6]       low cap:      0.132                                  Ah  ( 3.35%)
[ 7]       voltage:     12.468                                   V
[ 8]   charge rate:        N/A
[ 9]discharge rate:        N/A
[10]        charge:      3.940                                  Ah  (100.00%)
[11]      charging:        OFF
[12]  charge state:     NORMAL

I have tried "envsys -c file" with the file-contents
 acpibat0 {
        sensorN { user-capacity = 20; }
with N in the interval 0-12 - starting with 10.  All of them give syntax

However, I can set
 acpibat0 {
        sensor10 { critical-capacity = 20; }s Dinsensen-han
 acpibat0 {
        sensor10 { warning-capacity = 20; }
both give an ugly script.  Whenever the event "normal" arrives
the script (after some tests) must send the computer into sleep.  Whereas
the events "critical-over" or "warning-over" will have to be ignored
(again after some testing).  The value of the {critical,warning}-capacity
will be set from rc.local.

Kind regards
                        Hans Dinsen.Hansen

Home | Main Index | Thread Index | Old Index