From c18df0825b9ccbc844f2e5d65fdcdef802b6293d Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Tue, 23 Jul 2024 23:22:05 +0100 Subject: [PATCH] system-info: Always have a space before battery %age --- system-info/system-info-Linux.sh | 4 ++-- system-info/system-info-WSL.sh | 2 +- system-info/system-info-macOS.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system-info/system-info-Linux.sh b/system-info/system-info-Linux.sh index ab086e1..91a142e 100755 --- a/system-info/system-info-Linux.sh +++ b/system-info/system-info-Linux.sh @@ -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 } diff --git a/system-info/system-info-WSL.sh b/system-info/system-info-WSL.sh index 1a6b4e0..4f26f61 100755 --- a/system-info/system-info-WSL.sh +++ b/system-info/system-info-WSL.sh @@ -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 diff --git a/system-info/system-info-macOS.sh b/system-info/system-info-macOS.sh index 54a8f97..48f24b5 100755 --- a/system-info/system-info-macOS.sh +++ b/system-info/system-info-macOS.sh @@ -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