1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-16 09:50:06 +00:00

fix battery segment on macOS

issue #89
This commit is contained in:
romkatv 2019-06-18 09:59:27 +02:00
parent 7678930639
commit 95b25e94e1

View file

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