system-info: Enable CPU load and battery icon on macOS

This commit is contained in:
2023-01-06 21:44:05 +00:00
parent f4aed11002
commit 235bf058e5
2 changed files with 24 additions and 10 deletions

View File

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