1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-25 21:40:08 +00:00
This commit is contained in:
romkatv 2020-01-26 15:18:25 +01:00
parent b9cfa4e7ff
commit fa4d151f94

View file

@ -1174,7 +1174,7 @@ _p9k_prompt_battery_set_args() {
case $_p9k_os in case $_p9k_os in
OSX) OSX)
(( $+commands[pmset] )) || return (( $+commands[pmset] )) || return
local raw_data=${${(f)"$(pmset -g batt 2>/dev/null)"}[2]} local raw_data=${${(Af)"$(pmset -g batt 2>/dev/null)"}[2]}
[[ $raw_data == *InternalBattery* ]] || return [[ $raw_data == *InternalBattery* ]] || return
remain=${${(s: :)${${(s:; :)raw_data}[3]}}[1]} remain=${${(s: :)${${(s:; :)raw_data}[3]}}[1]}
[[ $remain == *no* ]] && remain="..." [[ $remain == *no* ]] && remain="..."