Windows 10 (bash): Fix battery usage
This commit is contained in:
parent
2f5b223200
commit
7735fb02a5
1 changed files with 5 additions and 0 deletions
5
neofetch
5
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)" ;;
|
||||
|
|
Loading…
Reference in a new issue