OpenBSD is a pretty strange OS

This commit is contained in:
Tudor 2016-02-23 11:24:38 +02:00
parent 845a76504b
commit cfa2df540c
1 changed files with 11 additions and 9 deletions

6
fetch
View File

@ -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")