How do I configure battery management for Salix Ratpoison?

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
rrttdd
Posts: 26
Joined: 28. Nov 2012, 18:49

How do I configure battery management for Salix Ratpoison?

Post by rrttdd »

Hi,

I few days ago I was called and left my Salix laptop alone (battery operated). When I left I first thought that I would be back in a few minutes. But in the end, I needed several hours.

When I came back, the laptop was off. I tried to restart it without power supply and battery operated. I was used to Windows, which always leaves about 5-7% of the battery's capacity when shutting down. But I was unable to start the laptop. So I connected it with the power supply and booted up Windows.

In Windows, the task bar tool showed a battery capacity of 0% remaining! :o As far as I know this is quite concerning, since the usual laptop battery should not run completely empty!

So I want to find a way to prevent that 'it's empty when it's empty" behaviour of the Salix power management in the future. How can I configure Salix to shut down earlier and leave a little rest of battery power?
User avatar
gapan
Salix Wizard
Posts: 6362
Joined: 6. Jun 2009, 17:40

Re: How do I configure battery management for Salix Ratpoiso

Post by gapan »

I had a complete solution for that once, but unfortunately I lost it all due to a broken hard drive. How good are you with shell scripting? The idea is to read the output of /proc/acpi/battery/BAT1/state to get the remaining capacity, read the output of /proc/acpi/battery/BAT1/info to get the design capacity, do the math (percent = 100*remaining/design) and create a cronjob that will run every few minutes that checks that percentage. I had set it up so that if it was <20%, I would get a ratpoison message at the top right that battery was low and if it was <5%, it would shut down gracefully. Even if you know only a little bit of scripting it might be a good exercise to do it. It could be that there are ready made solutions for something like that out there, but I'm not aware of them.
Image
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: How do I configure battery management for Salix Ratpoiso

Post by mimosa »

Sounds like a fun project. Not relevant to the specific problem, but xbattbar-acpi is in the 14.1 repositories. It shouldn't be too hard to build it and its (two) dependencies for 14.0; on the other hand, I think if you search the forums you should find links to packages for 14.0.

However, it has no early warning system ... just a constant graphical reminder of the level.
Post Reply