On Aug 4, 2019 12:10 PM, Walter Alejandro Iglesias <[email protected]> wrote: > > Hi Edgar, > > On Sun, Aug 04, 2019 at 11:43:19AM -0500, Edgar Pettijohn wrote: > > On Sun, Aug 04, 2019 at 05:33:41PM +0200, Walter Alejandro Iglesias wrote: > > > Hello, > > > > > > Since years I've been using a shell script of mine to shutdown my laptop > > > when battery is critical. Convenient because I made it portable among > > > unix-like systems. In the case of OpenBSD the script asks battery and > > > AC status to apm(4). > > > > > > Now I gave a try to the apmd(8) -Z option but, so far, I couldn't make > > > it work in a reliable way. I added to rc.conf.local: > > > > > > apmd_flags="-A -Z 20" > > > > > > But, after doing some tests, sometimes it works, other it seems like > > > it's totally ignored. > > > > Is your laptop plugged in during the tests? > > First of all, thank you for answering. :-) > > The cable is plugged to a multiple socket that has and interrupter. I > cut the energy from there while doing the tests, mainly because I'm > interested it work in that way. > > I'm not an electricity expert but I think I understand why you're asking > that question. If the AC cable is connected to the laptop, even when in > the other end it's not connected to the source, since the converter > holds some residual voltage could make the laptop think it's still > connected to the main source, right? But when the source is cut (in the > way I explained above,) apm(4) correctly says the AC power is > "disconnected," that's why I assumed apmd(8) should not be tricked by > the converter. >
Sounds good. I also have to add -t 60 for it to work on my laptop. Probably has a lot to do with the quality of the battery. Edgar > > > > Edgar > > > > > > > > Curious because power management seems to work fine in my T410. It > > > sleeps, resumes and hibernates perfectly. /var/log/messages and 'apmd > > > -d' don't show significant errors. Do I need to set something else, add > > > some -t value to ampd command or some script to /etc/apm? > > > > > > > > > Walter > > > >

