system-info: Always have a space before battery %age
This commit is contained in:
parent
2005b6140f
commit
c18df0825b
@ -35,11 +35,11 @@ if upower -e | grep 'BAT' 2> /dev/null; then
|
|||||||
local percentage=$(echo $output | awk '{ print $4 }')
|
local percentage=$(echo $output | awk '{ print $4 }')
|
||||||
if [ "$charging" = "Charging," ];then
|
if [ "$charging" = "Charging," ];then
|
||||||
echo $percentage | awk '$battery ~ /.*/ {
|
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
|
else
|
||||||
echo $percentage | awk '$battery ~ /.*/ {
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ while true; do
|
|||||||
| sed 's/\r//')
|
| sed 's/\r//')
|
||||||
if [ "" != "$raw_battery" ]; then
|
if [ "" != "$raw_battery" ]; then
|
||||||
battery="$(echo $raw_battery | awk '$battery ~ /.*/ {
|
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
|
fi
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ while true; do
|
|||||||
grep --color=never -Eo '\d+%' | \
|
grep --color=never -Eo '\d+%' | \
|
||||||
grep --color=never -Eo '\d+')"
|
grep --color=never -Eo '\d+')"
|
||||||
battery="$(echo $raw_battery | gawk '$battery ~ /.*/ {
|
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
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user