mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -07:00
Use word-regexp for osx cause we have for ex.: "AppleRawCurrentCapacity" and "CurrentCapacity"
This commit is contained in:
parent
75140e25a9
commit
2798ffe214
1 changed files with 1 additions and 1 deletions
|
@ -81,7 +81,7 @@ __battery() {
|
||||||
# MacOS support
|
# MacOS support
|
||||||
local key
|
local key
|
||||||
for key in CurrentCapacity MaxCapacity ExternalChargeCapable FullyCharged; do
|
for key in CurrentCapacity MaxCapacity ExternalChargeCapable FullyCharged; do
|
||||||
line=$(/usr/sbin/ioreg -n AppleSmartBattery -w0 | grep $key | sed -e 's/|//g' | awk '{ print $3 }')
|
line=$(/usr/sbin/ioreg -n AppleSmartBattery -w0 | grep -w $key | sed -e 's/|//g' | awk '{ print $3 }')
|
||||||
case "$key" in
|
case "$key" in
|
||||||
CurrentCapacity) rem="$line";;
|
CurrentCapacity) rem="$line";;
|
||||||
MaxCapacity) full="$line";;
|
MaxCapacity) full="$line";;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue