diff --git a/.config/i3blocks/battery b/.config/i3blocks/battery index 816a9fd..6321caf 100755 --- a/.config/i3blocks/battery +++ b/.config/i3blocks/battery @@ -1,21 +1,18 @@ #!/bin/bash set -euo pipefail -BATTERY=/sys/class/power_supply/BAT0 - ac_conn=0 - for ac in $(find /sys/class/power_supply -type l -name 'A*'); do [ $(cat "${ac}/online") -eq 1 ] && ac_conn=1 done bat_cap=() for bat in $(find /sys/class/power_supply -type l -name 'B*'); do - bat_cap+="$(cat "${bat}/capacity")%" + bat_cap+=("$(cat "${bat}/capacity")%") done if [ ${ac_conn} -eq 0 ]; then - printf '\uf58d %s' ${bat_cap[@]} + printf '\uf58d %s' "${bat_cap[*]}" else - printf '\uf740 %s' ${bat_cap[@]} + printf '\uf740 %s' "${bat_cap[*]}" fi diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 31c9218..4eadabd 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -51,7 +51,7 @@ interval=30 interval=30 [battery] -interval=30 +interval=10 [temp] interval=10