1
0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-12 19:18:28 +02:00

show battery as CHARGED on macos if it is at 100% and connected to power supply

This commit is contained in:
romkatv 2019-09-09 14:48:32 +02:00
parent daedc56b3d
commit fd96e92df6

View File

@ -922,7 +922,12 @@ prompt_battery() {
case "${${(s:; :)raw_data}[2]}" in
'charging'|'finishing charge'|'AC attached')
state=CHARGING
if (( bat_percent == 100 )); then
state=CHARGED
remain=''
else
state=CHARGING
fi
;;
'discharging')
(( bat_percent < _POWERLEVEL9K_BATTERY_LOW_THRESHOLD )) && state=LOW || state=DISCONNECTED