Merge pull request #98 from tudurom/master

Battery support for OpenBSD
This commit is contained in:
Dylan Araps 2016-02-23 20:41:20 +11:00
commit a04dcf075c

10
fetch
View file

@ -1405,6 +1405,16 @@ getbattery () {
esac esac
;; ;;
"OpenBSD")
battery0full=$(sysctl -n hw.sensors.acpibat0.watthour0)
battery0full=${battery0full/ Wh*}
battery0now=$(sysctl -n hw.sensors.acpibat0.watthour3)
battery0now="${battery0now/ Wh*}"
battery="$(echo "100 * $battery0now / $battery0full" | bc)%"
;;
"Mac OS X") "Mac OS X")
battery="$(pmset -g batt | grep -o '[0-9]*%')" battery="$(pmset -g batt | grep -o '[0-9]*%')"
;; ;;