OpenBSD is a pretty strange OS
This commit is contained in:
parent
845a76504b
commit
cfa2df540c
6
fetch
6
fetch
|
@ -1397,11 +1397,14 @@ getbattery () {
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*"BSD")
|
"BSD")
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
"FreeBSD"*)
|
"FreeBSD"*)
|
||||||
battery=$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}')
|
battery=$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}')
|
||||||
;;
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
"OpenBSD")
|
"OpenBSD")
|
||||||
battery0full=$(sysctl -n hw.sensors.acpibat0.watthour0)
|
battery0full=$(sysctl -n hw.sensors.acpibat0.watthour0)
|
||||||
battery0full=${battery0full/ Wh*}
|
battery0full=${battery0full/ Wh*}
|
||||||
|
@ -1410,7 +1413,6 @@ getbattery () {
|
||||||
battery0now="${battery0now/ Wh*}"
|
battery0now="${battery0now/ Wh*}"
|
||||||
|
|
||||||
battery="$(( 100 * $battery0now / $battery0full ))%"
|
battery="$(( 100 * $battery0now / $battery0full ))%"
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
|
|
Reference in New Issue