Fix trailing whitespaces, document cpu_usage in manpage

This commit is contained in:
Michael Stapelberg 2011-05-06 13:17:26 +02:00
parent 8b18e8e33c
commit 0b299f740d
3 changed files with 11 additions and 3 deletions

View File

@ -226,7 +226,7 @@ int main(int argc, char *argv[]) {
CFG_STR("format", "%5min %10min %15min", CFGF_NONE),
CFG_END()
};
cfg_opt_t usage_opts[] = {
CFG_STR("format", "%usage", CFGF_NONE),
CFG_END()
@ -376,7 +376,7 @@ int main(int argc, char *argv[]) {
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"));
}

View File

@ -200,6 +200,14 @@ Gets the temperature of the given thermal zone.
*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

View File

@ -14,7 +14,7 @@ static int prev_idle = 0;
* 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;