You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
613 B

#!/bin/sh
gpu_temp=""
if command -v nvidia-smi > /dev/null; then
gpu_temp=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)
gpu_temp=$(printf %3s $(echo ${gpu_temp##*+} | sed "s/\..*//") | tr ' ' ' ')
gpu_temp=" | $gpu_temp°C"
fi
model=$(cat /proc/cpuinfo | grep "model name" | head -n1)
icon="^b#282828^^c#dfdfdf^  ^d^"
if printf "$model " | grep -Fqe "AMD"; then
temp=$(sensors | awk '/Tctl/ {print $2}')
else
temp=$(sensors | awk '/Package id 0/ {print $4}')
fi
temp=$(printf %3s $(echo ${temp##*+} | sed "s/\..*//") | tr ' ' ' ')
echo "$icon $temp°C$gpu_temp "