[dev] Customizing string output

From: Wolfgang Corcoran-Mathe <first.lord.of.teal_AT_gmail.com>
Date: Sun, 9 Nov 2014 16:30:38 -0500

Hello all,

This is very much a noob question.

I am working on a toy text-only system monitor, for piping to
xsetroot, etc.; I wanted something like a minimal conky with all
of the parser stuff replaced by a straightforward config.h file.

Since all of the output is created by a single (at the moment)
printf call, is there an intelligent way to allow this command to be
customized within a config.h? Given a choice of monitor variables
(say, battery, load, fs_usage), the user should be able to choose
a format string without editing the main source file (the current,
dumb method).

Both the format string and the argument list would need to be
configured, that is:

Default example:

    printf("%s | %s | %s | %s", load, fs_usage, batt, time);

Customized version:

    printf("%s | %s | %s", fs_usage, load, batt);

Thanks for any input,

-- 
Wolfgang Corcoran-Mathe
Received on Sun Nov 09 2014 - 22:30:38 CET

This archive was generated by hypermail 2.3.0 : Sun Nov 09 2014 - 22:36:08 CET