conky/virt_temp.sh

20 lines
412 B
Bash
Executable File

#!/bin/zsh
#!/bin/zsh
temp=$(sensors pch_skylake-virtual-0 | grep temp1 | awk '{print $2}')
if [[ "${1}" == "-t" ]]; then
shift
echo -n "${temp}"
else
val=$(grep -Po '[\d.]+' <<< ${temp})
if [[ ${val} -le 30.0 ]]; then
printf "^fg(#0000cc)"
elif [[ ${val} -le 60.0 ]]; then
printf "^fg(#cc7700)"
elif [[ ${val} -gt 60.0 ]]; then
printf "^fg(#cc0000)"
fi
fi