mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-24 04:22:32 +00:00
Windows 10 (bash): Fix battery usage
This commit is contained in:
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)" ;;
|
||||
|
||||
Reference in New Issue
Block a user