cputemp: add amdgpu, prefer dedicated gpu

This commit is contained in:
mglae 2018-08-18 00:51:41 +02:00
parent eef941cb6b
commit 5a9f7f2819

View File

@ -19,14 +19,11 @@ if [ $(basename "$0") = "gputemp" -o "$1" = "gpu" ]; then
for hwmon in /sys/class/hwmon/*; do
if [ -f "${hwmon}/name" ]; then
case $(cat ${hwmon}/name) in
nouveau|radeon)
[[ -f "${hwmon}/temp1_input" ]] && TEMP="$(cat ${hwmon}/temp1_input)" && break
[[ -f "${hwmon}/temp2_input" ]] && TEMP="$(cat ${hwmon}/temp2_input)" && break
;;
coretemp)
nouveau|radeon|amdgpu)
[[ -f "${hwmon}/temp1_input" ]] && TEMP="$(cat ${hwmon}/temp1_input)" && break
[[ -f "${hwmon}/temp2_input" ]] && TEMP="$(cat ${hwmon}/temp2_input)" && break
;;
# intel gpu is supported by cpu coretemp below
esac
fi
done