#!/bin/bash # please update this script to fit your needs # this script is call every time the widget will be drawn, so keep it short and fast ;) # if the script is executed from system_information script set the locale back for "°C" LANG=de_DE.UTF-8 # there can be 4 files, cpu, gpu, pccase, motherboard rm -f ./cpu ./gpu ./pccase ./motherboard # intel core-i cpu temp #sensors -A coretemp-isa-0000 | grep "Core 0" | awk '{print $3}' | tr -d "+" > ./cpu # cpu temp CPUTEMP=($(sensors -A | grep "CPU Temperature")) CPUTEMP[2]=${CPUTEMP[2]/+} # +36.0°C -> 36.0°C #echo "${CPUTEMP[2]/./,}" > ./cpu # 36,0°C echo "${CPUTEMP[2]%.*}°C" > ./cpu # 36°C # pc case temp #sensors -A acpitz-virtual-0 | grep "temp1" | awk '{print $2}' | tr -d "+" > ./pccase # motherboard temp MBTEMP=($(sensors -A | grep "MB Temperature")) MBTEMP[2]=${MBTEMP[2]/+} # +36.0°C -> 36.0°C #echo "${MBTEMP[2]/./,}" > ./motherboard # 36,0°C echo "${MBTEMP[2]%.*}°C" > ./motherboard # 36°C # nvidia gpu temp # nvidia-settings must be run as the user of the x server GPU=$(nvidia-settings -c :0 -t -query GPUCoreTemp | head -n 1) echo "${GPU}°C" > ./gpu