From fd96e92df678da67fc35038c612fbdf95a0e9010 Mon Sep 17 00:00:00 2001
From: romkatv <roman.perepelitsa@gmail.com>
Date: Mon, 9 Sep 2019 14:48:32 +0200
Subject: show battery as CHARGED on macos if it is at 100% and connected to
 power supply

---
 internal/p10k.zsh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index e409c36c..96bee0bf 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -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
-- 
cgit v1.2.3