From: Garrett Holmstrom Date: Fri, 22 May 2020 06:17:43 +0000 (-0700) Subject: Fix darwin battery info field selection X-Git-Tag: v0.17.1~1^2 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=640f2a04330b690a0ed829b4dc47de442ce55c9f Fix darwin battery info field selection The batterydarwin function looks for the info it wants using field numbers that are off by one on the current version of Mac OS. I'm not sure which version this changed in or what exactly they added (I suspect it is the battery ID), but this patch makes battery info start working again. --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 2969729..817a9b5 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1856,7 +1856,7 @@ done function batterydarwin () { GRML_BATTERY_LEVEL='' local -a table -table=( ${$(pmset -g ps)[(w)7,8]%%(\%|);} ) +table=( ${$(pmset -g ps)[(w)8,9]%%(\%|);} ) if [[ -n $table[2] ]] ; then case $table[2] in charging)