system-info: Always have a space before battery %age

This commit is contained in:
Kenneth Benzie 2024-07-23 23:22:05 +01:00
parent 2005b6140f
commit c18df0825b
3 changed files with 4 additions and 4 deletions

View File

@ -35,11 +35,11 @@ if upower -e | grep 'BAT' 2> /dev/null; then
local percentage=$(echo $output | awk '{ print $4 }')
if [ "$charging" = "Charging," ];then
echo $percentage | awk '$battery ~ /.*/ {
printf "%3d%% %s\n", $battery, substr("󰢟󰢜󰂆󰂇󰂈󰢝󰂉󰢞󰂊󰂋󰂅", int($battery / 9), 1)
printf " %d%% %s\n", $battery, substr("󰢟󰢜󰂆󰂇󰂈󰢝󰂉󰢞󰂊󰂋󰂅", int($battery / 9), 1)
}'
else
echo $percentage | awk '$battery ~ /.*/ {
printf "%3d%% %s\n", $battery, substr("󰂎󰁺󰁻󰁼󰁽󰁾󰁿󰂀󰂁󰂂󰁹", int($battery / 9), 1)
printf " %d%% %s\n", $battery, substr("󰂎󰁺󰁻󰁼󰁽󰁾󰁿󰂀󰂁󰂂󰁹", int($battery / 9), 1)
}'
fi
}

View File

@ -39,7 +39,7 @@ while true; do
| sed 's/\r//')
if [ "" != "$raw_battery" ]; then
battery="$(echo $raw_battery | awk '$battery ~ /.*/ {
printf "%3d%% %s\n", $battery, substr("", int($battery / 9), 1)
printf " %d%% %s\n", $battery, substr("", int($battery / 9), 1)
}')"
fi

View File

@ -34,7 +34,7 @@ while true; do
grep --color=never -Eo '\d+%' | \
grep --color=never -Eo '\d+')"
battery="$(echo $raw_battery | gawk '$battery ~ /.*/ {
printf "%3d%% %s\n", $battery, substr("󰂎󰁺󰁻󰁼󰁽󰁾󰁿󰂀󰂁󰂂󰁹", int($battery / 9), 1)
printf " %d%% %s\n", $battery, substr("󰂎󰁺󰁻󰁼󰁽󰁾󰁿󰂀󰂁󰂂󰁹", int($battery / 9), 1)
}')"
fi