Commit 50290737 authored by Tudor's avatar Tudor

Added battery support for FreeBSD and fixed weird bug

parent fcc1d50b
......@@ -1398,11 +1398,20 @@ getbattery () {
battery="None"
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment