roman

@hi@romanzolotarev.com




homehttps://romanzolotarev.com

193 following, 485 followers

0 ★ 0 ↺

[?]roman » 🌐
@hi@romanzolotarev.com

here is the script

#!/bin/sh
b=$(apm -b) # 0 high, 1 low, 2 critical, 3 charging
l=$(apm -l) # %
m=$(apm -m) # minutes
if test "$m" = 'unknown'; then mm='-'; else mm="${m}m"; fi
p=$(apm -P) # 0
d=$(date +%Y%m%d-%H%M%S)
t=$(sysctl -n hw.sensors.acpithinkpad0.temp0 | cut -d. -f1)
f=$(sysctl -n hw.sensors.acpithinkpad0.fan0 | cut -d' ' -f1)
c=$(($(sysctl -n hw.sensors.cpu0.frequency0 | cut -d. -f1) / 1000000))
echo "$d ${c}mhz +${t} ${f}rpm $b ${l}% $mm"
output looks like this:

20260310-233201 450mhz +42 0rpm 0 74% -
running this script with crontab every minute:


*       *       *       *       *       /bin/sh heat.sh >> /var/log/heat.log

History