Commit 0871c362 authored by Dylan Araps's avatar Dylan Araps

Windows 10 (bash): Fix battery 2

parent 7735fb02
......@@ -1595,13 +1595,14 @@ getbattery() {
for bat in "/sys/class/power_supply/BAT"*; do
capacity="$(< ${bat}/capacity)"
status="$(< ${bat}/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
battery="${capacity}% [${status}]"
case "$battery_display" in
"bar") battery="$(bar "$capacity" 100)" ;;
"infobar") battery+=" $(bar "$capacity" 100)" ;;
......
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