diff --git a/neofetch b/neofetch index d87f21b0..d2693408 100755 --- a/neofetch +++ b/neofetch @@ -1597,6 +1597,11 @@ getbattery() { 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 + case "$battery_display" in "bar") battery="$(bar "$capacity" 100)" ;; "infobar") battery+=" $(bar "$capacity" 100)" ;;