DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 9th July 2022
hd77 hd77 is offline
Shell Scout
 
Join Date: Jan 2022
Posts: 97
Default battery management tool?

hey,

Im looking for a tool whom can manage a bit laptop/battery operations with openbsd, eg power it of when battery is really low level, or just simply hibernate, but doing it automatically like almost all OS do, even if they have to wake up without open lid when battery is too low, to hibernate?

on few laptops with old battery we already understood that it doesnt have such by default, and loose data (or not loose, but salvage poweroff because of oobattery) could be managed by a tool?

thank you vm

ps: I already tried with xfce, a battery monitor/notificatoin is available in the interface module, but crashes immediately, not usable at all... and I don't have fun with watching power LED (on the side) every five minutes..
Reply With Quote
  #2   (View Single Post)  
Old 9th July 2022
jmccue jmccue is offline
Real Name: John McCue
Package Pilot
 
Join Date: Aug 2012
Location: here
Posts: 167
Default

Check out manual apmd(8), it does all you want except shows you the level.

For battery level you can query it using apn(8) and sysctl(8). I have a simple cron script that echos status out to /dev/console and it shows up in xconsole(1) every 8 minutes I think.
__________________
[t]csh(1) - "An elegant shell, for a more... civilized age."
- Paraphrasing Star Wars (tvtropes.org)
Reply With Quote
  #3   (View Single Post)  
Old 9th July 2022
hd77 hd77 is offline
Shell Scout
 
Join Date: Jan 2022
Posts: 97
Default

Quote:
Originally Posted by jmccue View Post
Check out manual apmd(8), it does all you want except shows you the level.

For battery level you can query it using apn(8) and sysctl(8). I have a simple cron script that echos status out to /dev/console and it shows up in xconsole(1) every 8 minutes I think.

hi,

thank you for your reply
if you have a script doing so, in addition with alerts (x/window alerts too?), do you mind to share it please?
Reply With Quote
  #4   (View Single Post)  
Old 9th July 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by jmccue View Post
...apn(8)...
I'm sure you meant apm(8).

I track battery usage on screen with the i3 window manager's i3bar utility, use the apmd(8) -Z option to auto-hibernate, and suspend/resume with my laptop lid.
Reply With Quote
  #5   (View Single Post)  
Old 10th July 2022
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bitchy Nerd Elitist
 
Join Date: Dec 2015
Location: London
Posts: 461
Default

Quote:
Originally Posted by harrollld View Post
I already tried with xfce, a battery monitor/notificatoin is available in the interface module, but crashes immediately, not usable at all...
Did you check ~/.xsession-errors for anything relevant? The battery monitor should work.
__________________
Are you infected with Wetiko?
Reply With Quote
  #6   (View Single Post)  
Old 17th July 2022
hd77 hd77 is offline
Shell Scout
 
Join Date: Jan 2022
Posts: 97
Default

I tried by doing the following with apm :
/etc/rc.conf.local:
apmd_flags=-A -z 15 -Z 12
/etc/rc.conf
apmd_flags=-z 15 -Z 12

but it doesnt like to be working..
Reply With Quote
  #7   (View Single Post)  
Old 17th July 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by harrollld View Post
I tried by doing the following with apm :
/etc/rc.conf.local:
apmd_flags=-A -z 15 -Z 12
/etc/rc.conf
apmd_flags=-z 15 -Z 12


but it doesnt like to be working..
Editing /etc/rc.conf is never recommended. 1) Any provisions there are ignored if they are superceded by provisions in /etc/rc.conf.local, and 2) /etc/rc.conf is subject to a replacement by any future upgrade.

Your "-z 15" will not ever be used, as you have "-Z 10" provisioned. Choose -Z or -z, not both. The apmd(8) man page states:
Quote:
If both -Z and -z are specified, the last one will supersede the other.

Last edited by jggimi; 17th July 2022 at 08:39 PM. Reason: clarity
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get the remaining battery percentage (6.2) bsd-keith OpenBSD General 2 1st February 2018 04:47 PM
i7 temp. / battery life ? NaWi OpenBSD General 2 8th August 2015 04:16 PM
Shutting down on low battery kmike OpenBSD General 5 30th March 2015 04:18 PM
Beep low battery tixx8542 OpenBSD General 8 25th December 2014 01:10 PM
Wireless networking xor battery monitor Nobber OpenBSD General 5 27th February 2009 12:25 PM


All times are GMT. The time now is 04:02 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick