1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-25 13:30:07 +00:00

fix: Fix the logic of displaying the remain time when battery is charged or charging.

This commit is contained in:
Li Haoyuan 2024-07-12 02:37:25 +08:00
parent bc0f9341da
commit 71d628cc8a

View file

@ -1495,12 +1495,11 @@ _p9k_prompt_battery_set_args() {
state=DISCONNECTED state=DISCONNECTED
fi 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 if (( bat_percent == 100 )); then
remain=''
state=CHARGED state=CHARGED
else else
(( bat_remain_minutes < 71582788 )) && remain=$((bat_remain_minutes/60)):${(l#2##0#)$((bat_remain_minutes%60))} || remain=''
state=CHARGING state=CHARGING
fi fi
;; ;;