Add battery icon in system-info-WSL.sh

This commit is contained in:
Kenneth Benzie 2022-12-30 17:52:36 +00:00
parent b2158b5f93
commit f4aed11002

View File

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