Compare commits

..

1 Commits

Author SHA1 Message Date
2b26a4fa84 Update system-info macOS user agent
Add CPU temperature to `status-info`, conditionally display battery
charge percentage, and documents the commands.
2021-02-17 20:45:44 +00:00

View File

@ -19,9 +19,10 @@ ioreg -w0 -l|grep BatteryInstalled &> /dev/null && \
while true; do
# Get the current CPU temperature.
cpu_temp="`/usr/local/bin/osx-cpu-temp`"
if $has_battery; then
# Parse the current battery charge percentage.
$has_battery && \
battery=" `pmset -g batt | grep --color=never -Eo '\d+%'` ↯"
fi
# Write to the cache file.
echo "$cpu_temp$battery" > $cache_file
# Don't spin, sleep instead.