turns out we can read motherboard sensors

This commit is contained in:
Drath
2025-10-07 18:25:40 +02:00
parent 6f09d9a9eb
commit 9ec37e2f14
2 changed files with 18 additions and 0 deletions

View File

@@ -20,4 +20,14 @@ void sys::getDisk(Memory* disk, std::string mount) {
disk->free = diskData.f_bfree * diskData.f_frsize;
disk->used = (diskData.f_blocks - diskData.f_bfree) * diskData.f_frsize;
disk->total = diskData.f_blocks * diskData.f_frsize;
}
void sys::detectHwmon(sysSensors* s) {
s->hwmon = getFirstDir("/sys/devices/platform/nct6775.656/hwmon"); // we hardcode the chip path, should be sane
}
void sys::updateSensors(sysSensors* s) {
s->fan_speed[0] = std::stol(readFile(s->hwmon + "/fan2_input", 4));
s->fan_speed[1] = std::stol(readFile(s->hwmon + "/fan7_input", 4));;
s->t_sensor = std::stol(readFile(s->hwmon + "/temp5_input", 2));
}