From 71d628cc8a4b157f7e6a8546a68f2c85efde9b39 Mon Sep 17 00:00:00 2001 From: Li Haoyuan <1513624626@qq.com> Date: Fri, 12 Jul 2024 02:37:25 +0800 Subject: [PATCH] fix: Fix the logic of displaying the remain time when battery is charged or charging. --- internal/p10k.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2b64543a..f4c03fa3 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1495,12 +1495,11 @@ _p9k_prompt_battery_set_args() { state=DISCONNECTED fi ;; - '2'|'6'|'7'|'8'|'9'|'11') + '2'|'6'|'7'|'8'|'9'|'11') # In this case, the battery is likely to be charged and disconnected, or still been charging. + remain='' if (( bat_percent == 100 )); then - remain='' state=CHARGED else - (( bat_remain_minutes < 71582788 )) && remain=$((bat_remain_minutes/60)):${(l#2##0#)$((bat_remain_minutes%60))} || remain='' state=CHARGING fi ;;