Windows 10 (bash): Fix battery usage

This commit is contained in:
Dylan Araps 2016-10-29 11:41:50 +11:00
parent 2f5b223200
commit 7735fb02a5

View file

@ -1597,6 +1597,11 @@ getbattery() {
status="$(< ${bat}/status)" status="$(< ${bat}/status)"
battery="${capacity}% [${status}]" battery="${capacity}% [${status}]"
# Fix for bash on Windows 10 which includes /proc files
# for battery usage despite there not being a battery
# installed.
[ -z "$capacity" ] && return
case "$battery_display" in case "$battery_display" in
"bar") battery="$(bar "$capacity" 100)" ;; "bar") battery="$(bar "$capacity" 100)" ;;
"infobar") battery+=" $(bar "$capacity" 100)" ;; "infobar") battery+=" $(bar "$capacity" 100)" ;;