bin/temps @ 6c4c335faf47

Merge
author Steve Losh <steve@stevelosh.com>
date Tue, 06 Aug 2024 10:56:16 -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