Post by @rqm
I desperately need an #OpenBSD battery script that gives me a BIG alert when my laptop battery gets down to 5%. I think apmd ought to be able to do this. Has anyone anything? I use i3 btw.
EDIT: I thought it was solved but it isn't.
5 likes
@rqm I use upower: `upower -b`. It shows me a lot of useful statistics.
I have a custom widget in Polybar that display the current percentage and remaining time when I'm on battery and when I'm charging it.
@rqm I use upower: `upower -b`. It shows me a lot of useful statistics.
I have a custom widget in Polybar that display the current percentage and remaining time when I'm on battery and when I'm charging it.
@hund@fosstodon.org Cool! I've got a custom polybar widget as well, calling a little sysctl script. Only thing is I often don't glance at it frequently enough so I really could use an alert. Here's the script btw:
$ cat ~/.scripts/battery.sh
#!/bin/sh
batt_percent=`sysctl -n hw.sensors.acpisbs0.percent0 | awk '{print $1;}'`
charging=`sysctl -n hw.sensors.acpiac0.indicator0 | awk '{print $1;}'`
if [ "$charging" == "On" ]; then
echo "$batt_percent+"
else
echo "$batt_percent"
fi
@rqm this might work for you:
uncomment
#*.emerg *
in /etc/syslog.conf and restart syslogd. apmd will scream at you on all consoles (xterms) when the battery drops below 25% (iirc).
