style: replace raw ps aux with filtered and sorted process list in print_load

This commit is contained in:
retoor 2024-12-11 20:04:49 +00:00
parent 9fc380f11d
commit 1377688ae0
2 changed files with 1 additions and 1 deletions

BIN
dot

Binary file not shown.

2
dot.c
View File

@ -18,7 +18,7 @@ void print_load() {
return;
}
if(loadavg[0] > 2.0){
int result = system("ps aux");
int result = system("ps aux | awk '$3 > 1.0' | sort -k3 -nr");
(void)result;
}
printf("%.2f %.2f %.2f", loadavg[0], loadavg[1], loadavg[2]);