1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-28 01:28:30 +00:00

Improve docs and parsing of graph args further.

This commit is contained in:
Brenden Matthews 2009-07-04 22:03:12 -06:00
parent 52c68c094c
commit ae6c02b0c8
2 changed files with 8 additions and 8 deletions

View File

@ -934,7 +934,7 @@
default_graph_size config setting. Takes the switch '-t' to default_graph_size config setting. Takes the switch '-t' to
use a temperature gradient, which makes the gradient values use a temperature gradient, which makes the gradient values
change depending on the amplitude of a particular graph change depending on the amplitude of a particular graph
value (try it and see). value (try it and see). If -t or -l is your first argument, you may need to preceed it by a space (' ').
<para /></listitem> <para /></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
@ -978,7 +978,7 @@
<option>interval (-t) (-l) command</option> <option>interval (-t) (-l) command</option>
</term> </term>
<listitem>Same as execgraph, but takes an interval arg and <listitem>Same as execgraph, but takes an interval arg and
graphs values. graphs values. If -t or -l is your first argument, you may need to preceed it by a space (' ').
<para /></listitem> <para /></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
@ -1716,8 +1716,10 @@
<command> <command>
<option>loadavg</option> <option>loadavg</option>
</command> </command>
<option>(1|2|3)
</option>
</term> </term>
<listitem>(1,2,3)&gt; System load average, 1 is for past 1 <listitem>System load average, 1 is for past 1
minute, 2 for past 5 minutes and 3 for past 15 minutes. minute, 2 for past 5 minutes and 3 for past 15 minutes.
<para /></listitem> <para /></listitem>
</varlistentry> </varlistentry>
@ -1726,7 +1728,7 @@
<command> <command>
<option>loadgraph</option> <option>loadgraph</option>
</command> </command>
<option>(height),(width) (gradient colour 1) (gradient <option>(1|2|3) (height),(width) (gradient colour 1) (gradient
colour 2) (scale) (-t) (-l)</option> colour 2) (scale) (-t) (-l)</option>
</term> </term>
<listitem>Load1 average graph, similar to xload, with <listitem>Load1 average graph, similar to xload, with

View File

@ -119,14 +119,12 @@ char *scan_graph(const char *args, int *w, int *h,
*tempgrad = FALSE; *tempgrad = FALSE;
*showaslog = FALSE; *showaslog = FALSE;
if (args) { if (args) {
if (strstr(args, " "TEMPGRAD)) { if (strstr(args, " "TEMPGRAD) || strncmp(args, TEMPGRAD, strlen(TEMPGRAD)) == 0) {
*tempgrad = TRUE; *tempgrad = TRUE;
} }
if (strstr(args, " "LOGGRAPH)) { if (strstr(args, " "LOGGRAPH) || strncmp(args, LOGGRAPH, strlen(LOGGRAPH)) == 0) {
*showaslog = TRUE; *showaslog = TRUE;
} }
DBGP("printing graph as %s, other args are: %s", (*showaslog ? "log" : "normal"), args);
//check the rest of the args
if (sscanf(args, "%d,%d %x %x %u", h, w, first_colour, last_colour, scale) == 5) { if (sscanf(args, "%d,%d %x %x %u", h, w, first_colour, last_colour, scale) == 5) {
return NULL; return NULL;
} }