change cpu temp command
This commit is contained in:
@@ -52,7 +52,7 @@ def check_memory():
|
||||
return memory
|
||||
|
||||
def check_cpu_temp():
|
||||
full_cmd = "cat /sys/class/thermal/thermal_zone*/temp | sed 's/\(.\)..$//' | tail -n 1"
|
||||
full_cmd = "paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp 2>&1) | column -s $'\t' -t | sed 's/\(.\)..$//' | grep 'pkg\|cpu'| awk '{print $NF}' | tail -n 1"
|
||||
try:
|
||||
p = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
|
||||
cpu_temp = p.decode("utf-8").replace('\n', ' ').replace('\r', '')
|
||||
|
||||
Reference in New Issue
Block a user