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

24 lines
490 B
Plaintext
Raw Normal View History

2019-09-07 17:42:18 +02:00
#!/bin/sh
2023-10-22 23:15:30 +02:00
model=$(cat /proc/cpuinfo | grep "model name" | head -n1)
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
if [ $temp -gt 100 ]
then
icon="^b#282828^^c#ff0000^  ^d^"
elif [ $temp -gt 80 ]
then
icon="^b#282828^^c#ffff00^  ^d^"
else
icon="^b#282828^^c#dfdfdf^  ^d^"
fi
echo "$icon"