bin/temps @ 8e22b36e5cba

More
author Steve Losh <steve@stevelosh.com>
date Wed, 17 Jul 2024 15:51:26 -0400
parents eb9f31c299b8
children (none)
#!/usr/bin/env bash

set -euo pipefail

function find_names {
    grep . /sys/class/hwmon/hwmon*/name
}
function find_coretemp {
    grep 
}

if test -z "${1:-}"; then
    find_names
else
    dir=$(find_names | grep "$1" | cut -d / -f 5)
    paste \
        <(grep . "/sys/class/hwmon/$dir/"temp*_label | sort) \
        <(grep . "/sys/class/hwmon/$dir/"temp*_input | sort) \
        | tr -s ':' ' ' \
        | awk '/Core/ {print $2, $3, $5/1000.0 }' \
        | sort -n -k2
fi