1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-19 02:17:44 +01:00

24 lines
613 B
Plaintext
Raw Normal View History

2019-09-07 17:42:18 +02:00
#!/bin/sh
2023-10-22 23:15:30 +02:00
gpu_temp=""
2023-10-17 05:18:46 +02:00
2023-10-22 23:15:30 +02:00
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
2023-10-17 05:18:46 +02:00
temp=$(sensors | awk '/Tctl/ {print $2}')
2023-10-22 23:15:30 +02:00
else
temp=$(sensors | awk '/Package id 0/ {print $4}')
fi
2023-10-17 05:18:46 +02:00
temp=$(printf %3s $(echo ${temp##*+} | sed "s/\..*//") | tr ' ' ' ')
2023-10-22 23:15:30 +02:00
echo "$icon $temp°C$gpu_temp "