|
@@ -7,8 +7,8 @@ battery_count=${#output[@]}
|
|
for line in "${output[@]}";
|
|
for line in "${output[@]}";
|
|
do
|
|
do
|
|
percentages+=($(echo "$line" | grep -o -m1 '[0-9]\{1,3\}%' | tr -d '%'))
|
|
percentages+=($(echo "$line" | grep -o -m1 '[0-9]\{1,3\}%' | tr -d '%'))
|
|
- statuses+=($(echo "$line" | egrep -o -m1 'Discharging|Charging|AC|Full|Unknown'))
|
|
|
|
- remaining=$(echo "$line" | egrep -o -m1 '[0-9][0-9]:[0-9][0-9]')
|
|
|
|
|
|
+ statuses+=($(echo "$line" | grep -E -o -m1 'Discharging|Charging|AC|Full|Unknown'))
|
|
|
|
+ remaining=$(echo "$line" | grep -E -o -m1 '[0-9][0-9]:[0-9][0-9]')
|
|
if [[ -n $remaining ]]; then
|
|
if [[ -n $remaining ]]; then
|
|
remainings+=(" ($remaining)")
|
|
remainings+=(" ($remaining)")
|
|
else
|
|
else
|