bin/temps @ eb9f31c299b8

Merge
author Steve Losh <steve@stevelosh.com>
date Tue, 02 Jul 2024 10:03:59 -0400
parents (none)
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