Display charging status in Windows (#1575)

This commit is contained in:
Rashil Gandhi 2020-10-04 19:07:50 +05:30 committed by GitHub
parent 075eb43dd7
commit c511bcbcef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3686,6 +3686,9 @@ get_battery() {
battery="$(wmic Path Win32_Battery get EstimatedChargeRemaining)"
battery="${battery/EstimatedChargeRemaining}"
battery="$(trim "$battery")%"
state="$(wmic /NameSpace:'\\root\WMI' Path BatteryStatus get Charging)"
state="${state/Charging}"
[[ "$state" == *TRUE* ]] && battery_state="charging"
;;
"Haiku")