mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Fix CPU load values
This commit is contained in:
@ -32,10 +32,10 @@ auto waybar::modules::Cpu::update() -> void {
|
||||
ALabel::update();
|
||||
}
|
||||
|
||||
uint16_t waybar::modules::Cpu::getCpuLoad() {
|
||||
double waybar::modules::Cpu::getCpuLoad() {
|
||||
double load[1];
|
||||
if (getloadavg(load, 1) != -1) {
|
||||
return load[0] * 100 / sysconf(_SC_NPROCESSORS_ONLN);
|
||||
return load[0];
|
||||
}
|
||||
throw std::runtime_error("Can't get Cpu load");
|
||||
}
|
||||
|
Reference in New Issue
Block a user