Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Apr 2008 14:58:33 +0300
From:      "Ivailo Bonev" <ibb_orac@mbox.contact.bg>
To:        "Michael Neumann" <mneumann@ntecs.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: HP 6720s automatic shutdown on low battery
Message-ID:  <004b01c894b8$e011b7d0$f800000a@chameleon>
References:  <003901c89496$189b5f20$f800000a@chameleon> <47F36D16.6040300@ntecs.de>

next in thread | previous in thread | raw e-mail | index | archive | help

----- Original Message ----- 
From: "Michael Neumann" <mneumann@ntecs.de>
Newsgroups: gmane.os.freebsd.questions
To: "Ivailo Bonev" <ibb_orac@mbox.contact.bg>
Cc: <freebsd-questions@freebsd.org>
Sent: Wednesday, April 02, 2008 2:25 PM
Subject: Re: HP 6720s automatic shutdown on low battery


> Ivailo Bonev wrote:
>> I have a new HP 6720s laptop. When discharge battery, FreeBSD don't 
>> shutdown automatically on low battery.
>> How can set that?
> 
> I've an 6710b and experienced similar "shutdowns" :)
> 
> Try this:
> 
> /etc/rc.conf:
> 
>   devd_enable="YES"
> 
> /etc/devd.conf:
> 
>   notify 10 {
>         match "system"         "ACPI";
>         match "subsystem"      "CMBAT";
>         match "notify"         "0x80";
>         action "/etc/acpi_battery 30 5";
Is thiese numbers after "acpi_battery" are minutes?
>   };
> 
> /etc/acpi_battery:
> 
>   #!/bin/sh
> 
>   warn_level=$1
>   shutdown_level=$2
> 
>   life=`sysctl -n hw.acpi.battery.life`
> 
>   if [ "$life" -lt $shutdown_level ]; then
>     echo "shutdown"
>     /sbin/shutdown -h now
>   elif [ "$life" -lt $warn_level ]; then
>     echo "warn"
>   fi
> 
> There might be an easier way, if there is a different notify command for 
> battery low. I guess 0x80 is just battery info.
> 
> Regards,
> 
>   Michael

Thanks, I'll try script when battery is up, to see if works for me.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?004b01c894b8$e011b7d0$f800000a>