CFG_STR("format", "%5min %10min %15min", CFGF_NONE),
CFG_END()
};
-
+
cfg_opt_t usage_opts[] = {
CFG_STR("format", "%usage", CFGF_NONE),
CFG_END()
CASE_SEC_TITLE("cpu_temperature")
print_cpu_temperature_info(atoi(title), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"));
-
+
CASE_SEC("cpu_usage")
print_cpu_usage(cfg_getstr(sec, "format"));
}
*Example format*: +T: %degrees °C+
+=== CPU Usage
+
+Gets the percentual CPU usage from +/proc/stat+.
+
+*Example order*: +cpu_usage+
+
+*Example format*: +%usage+
+
=== Load
Gets the system load (number of processes waiting for CPU time in the last
* percentage.
*
*/
-void print_cpu_usage(const char *format) {
+void print_cpu_usage(const char *format) {
const char *walk;
char buf[1024];
int curr_user, curr_nice, curr_system, curr_idle, curr_total;