# [Solved] Auto hibernate on low battery

## lyallp

I have a new install on a HP laptop.

I have been following the Gentoo Power Management Guide but I see nowhere that describes how I would perform an automatic 'hibernate' on low battery.

I use Fluxbox as my desktop manager, so I don't have any of the heavier desktop applets.

Basically, I am quite happy to have my laptop suddenly hibernate, rather than have the laptop suddenly turn off, like it has done.

Maybe some sort of xmessage popup on imminent hibernation would be nice.

Suggestions welcomed.

----------

## lyallp

found it.

app-laptop/laptop-mode-tools

/etc/laptop-mode/conf.d/auto-hibernate.conf

Same thing applies to auto-dimming my LCD Backlight on my HP Elitebook 8540w.

I had to tweak the kernel parameter 

Power management and ACPI options

-> ACPI (Advanced Configuration and Power Interface) Support

-> video (as a module)

Then make 'video' autoload in /etc/modules.autoload.d/kernel-2.6

Then, dig around in /proc/acpi/video/*/LCD/* looking for a file called brightness.

Edit /etc/laptop-mode/conf.d/lcd-brightness.conf

CONTROL_BRIGHTNESS=1

BRIGHTNESS_OUTPUT=<the /proc/file you found>

and put appropriate values in the BRIGHTNESS_COMMAND values.

I have yet to re-test auto hibernation, that takes a bit of time, but the brightness stuff works a treat.

----------

## UncleTom

 *lyallp wrote:*   

> 
> 
> I had to tweak the kernel parameter 
> 
> Power management and ACPI options
> ...

 

Thanks! 

I have the same laptop and couldn't find how to change the brightness. With this parameter enabled (I built it right into the kernel), I can now adjust the brightness in KDE's battery monitor.

However, I still cannot change the brightness using the brightness adjustment keys (<fn><f9> and <fn><f10> on my keyboard). Did you manage to get these to work also?

----------

## lyallp

Yep, I use fluxbox. I assigned the keys to execute a little program I wrote to increase/decrease the brightness.

I have no idea how KDE does it.

I can post details tomorrow, when I am on the laptop in question.

I still have not got the brightness sensor working, although, I did get the accelerometer working,  to the point of having a bit of code which detects if the laptop is dropped and parks the drive - the code is actually in kernel sources. I never got it working as a joystick, using 'neverball' as the tester, though.

The fingerprint scanner, I have not even bothered to try.

----------

## UncleTom

 *lyallp wrote:*   

> Yep, I use fluxbox. I assigned the keys to execute a little program I wrote to increase/decrease the brightness.
> 
> I have no idea how KDE does it.
> 
> 

 

Nor do I and using the brightness control in the battery monitor applet works with the kernel parameter you suggested. But sometimes I'm just too lazy to reach for the mouse. Assigning the keys in KDE to run your program should not be too difficult, I reckon.

 *lyallp wrote:*   

> 
> 
> I can post details tomorrow, when I am on the laptop in question.
> 
> 

 

That would be great, thanks.

 *lyallp wrote:*   

> 
> 
> I still have not got the brightness sensor working, although, I did get the accelerometer working,  to the point of having a bit of code which detects if the laptop is dropped and parks the drive - the code is actually in kernel sources. I never got it working as a joystick, using 'neverball' as the tester, though.
> 
> The fingerprint scanner, I have not even bothered to try.

 

I haven't bothered with any of these things. Especially the fingerprint scanner, I don't trust these things.

----------

## lyallp

I will create a new thread to identify the new stuff.

See this post

----------

