summaryrefslogtreecommitdiff
path: root/widgets/temperatures/temperatures.default
blob: 2f39ef1c7b7fec275ea2dc10ae31a37b80990a05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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 ;)

OUTPUTFLDR="/tmp/skinflatplus/widgets/temperatures"
mkdir -p ${OUTPUTFLDR}

# 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 ${OUTPUTFLDR}/cpu ${OUTPUTFLDR}/pccase ${OUTPUTFLDR}/gpu ${OUTPUTFLDR}/motherboard

# intel core-i cpu temp
sensors -A coretemp-isa-0000 | grep "Core 0" | awk '{print $3}' | tr -d "+" > ${OUTPUTFLDR}/cpu

# pc case temp
#sensors -A acpitz-virtual-0 | grep "temp1" | awk '{print $2}' | tr -d "+" > ${OUTPUTFLDR}/pccase

# motherboard temp
sensors -A acpitz-virtual-0 | grep "temp1" | awk '{print $2}' | tr -d "+" > ${OUTPUTFLDR}/motherboard

# nvidia gpu temp
# nvidia-settings must be run as the user of the x server
GPU="$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)"
echo "${GPU}°C" > ${OUTPUTFLDR}/gpu