1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-20 10:37:46 +01:00

26 lines
470 B
Plaintext
Raw Normal View History

2023-10-22 23:30:29 +02:00
#!/bin/sh
icon="^b#282828^^c#dfdfdf^ ^d^"
2023-10-22 23:30:29 +02:00
temp=""
if command -v nvidia-smi > /dev/null; then
temp=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)
temp=$(printf %3s $(echo ${temp##*+} | sed "s/\..*//") | tr ' ' ' ')
2023-10-22 23:33:10 +02:00
else
echo ""
return
2023-10-22 23:30:29 +02:00
fi
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"