Skip to content

Commit

Permalink
Fix darwin battery info field selection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gholms committed May 22, 2020
1 parent 1d927f2 commit 640f2a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion etc/zsh/zshrc
Expand Up @@ -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)
Expand Down

0 comments on commit 640f2a0

Please sign in to comment.