From 7735fb02a569986dbe0af8757f99e1ac6d7004af Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 29 Oct 2016 11:41:50 +1100 Subject: [PATCH] Windows 10 (bash): Fix battery usage --- neofetch | 5 +++++ 1 file changed, 5 insertions(+) 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)" ;;