Merge pull request #95 from tudurom/master

Add Battery Support for FreeBSD
This commit is contained in:
Dylan Araps 2016-02-23 19:15:37 +11:00
commit 4f51ecca75
1 changed files with 10 additions and 1 deletions

11
fetch
View File

@ -1399,10 +1399,19 @@ getbattery () {
fi
;;
"BSD")
case "$distro" in
"FreeBSD"*)
battery=$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}')
;;
esac
;;
"Mac OS X")
battery="$(pmset -g batt | grep -o '[0-9]*%')"
;;
"Windows")
battery="$(wmic Path Win32_Battery get EstimatedChargeRemaining /value)"
battery=${battery/EstimatedChargeRemaining'='}
@ -2081,7 +2090,7 @@ stdout () {
*)
"get$func" 2>/dev/null
eval output="\$$func"
printf "$output "
printf "%s" "$output "
;;
esac
done