m
This commit is contained in:
parent
00357793e1
commit
fc238b0c89
|
@ -12,13 +12,13 @@ class SystemInfoModule(BaseModule):
|
||||||
with open("/sys/class/thermal/thermal_zone0/temp", "r") as f:
|
with open("/sys/class/thermal/thermal_zone0/temp", "r") as f:
|
||||||
temp_str = f.read()
|
temp_str = f.read()
|
||||||
cpu_temp = round(int(temp_str) / 1000.0, 1)
|
cpu_temp = round(int(temp_str) / 1000.0, 1)
|
||||||
lines.append(f"CPU Temp: {cpu_temp}°C")
|
lines.append(f"{cpu_temp}°C")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
lines.append("CPU Temp: N/A")
|
lines.append("N/A°C")
|
||||||
|
|
||||||
# CPU usage
|
# CPU usage
|
||||||
cpu_usage = psutil.cpu_percent(interval=0.2)
|
cpu_usage = psutil.cpu_percent(interval=0.2)
|
||||||
lines.append(f"CPU Usage: {cpu_usage}%")
|
lines.append(f"CPU: {cpu_usage}% ")
|
||||||
|
|
||||||
# Memory usage
|
# Memory usage
|
||||||
mem = psutil.virtual_memory()
|
mem = psutil.virtual_memory()
|
||||||
|
|
Loading…
Reference in a new issue