Display charging status in Windows (#1575)
This commit is contained in:
parent
075eb43dd7
commit
c511bcbcef
3
neofetch
3
neofetch
|
@ -3686,6 +3686,9 @@ get_battery() {
|
||||||
battery="$(wmic Path Win32_Battery get EstimatedChargeRemaining)"
|
battery="$(wmic Path Win32_Battery get EstimatedChargeRemaining)"
|
||||||
battery="${battery/EstimatedChargeRemaining}"
|
battery="${battery/EstimatedChargeRemaining}"
|
||||||
battery="$(trim "$battery")%"
|
battery="$(trim "$battery")%"
|
||||||
|
state="$(wmic /NameSpace:'\\root\WMI' Path BatteryStatus get Charging)"
|
||||||
|
state="${state/Charging}"
|
||||||
|
[[ "$state" == *TRUE* ]] && battery_state="charging"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Haiku")
|
"Haiku")
|
||||||
|
|
Reference in New Issue