mirror of https://github.com/tiyn/dotfiles
parent
b97537db9e
commit
751cc5fbfe
@ -1,12 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
icon="^b#282828^^c#dfdfdf^ ^d^ "
|
||||
gpu_temp=""
|
||||
|
||||
if [ "$1" = "amd" ]; then
|
||||
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}')
|
||||
elif [ "$1" = "intel" ]; then
|
||||
else
|
||||
temp=$(sensors | awk '/Package id 0/ {print $4}')
|
||||
fi
|
||||
|
||||
temp=$(printf %3s $(echo ${temp##*+} | sed "s/\..*//") | tr ' ' ' ')
|
||||
echo "$icon$temp°C"
|
||||
|
||||
echo "$icon $temp°C$gpu_temp "
|
||||
|
Loading…
Reference in new issue