diff --git a/ChangeLog b/ChangeLog index 3c5149c5..8fcd074e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-12-18 + * Fix segfault for diskiograph*, note the changed order of arguments + * Fix documentation for all graph objects + 2008-12-17 * Make gateway objects also detect routes with missing RTF_GATEWAY flag diff --git a/README b/README index 7ab73f98..4670534b 100644 --- a/README +++ b/README @@ -640,8 +640,8 @@ conky(1) conky(1) $cpu for more info on SMP. - 1mcpugraph normal|log (cpu number) (height),(width) (gradient colour 1)0m - 1m(gradient colour 2)0m + 1mcpugraph ("normal"|"log") (height),(width) (gradient colour 1) (gradi‐0m + 1ment colour 2) (scale) (cpu number)0m CPU usage graph, with optional colours in hex, minus the #. See $cpu for more info on SMP. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". @@ -652,8 +652,8 @@ conky(1) conky(1) of sda for /dev/sda. Individual partitions are allowed. - 1mdiskiograph normal|log (device) (height),(width) (gradient colour 1)0m - 1m(gradient colour 2) (scale)0m + 1mdiskiograph ("normal"|"log") (height),(width) (gradient colour 1) (gra‐0m + 1mdient colour 2) (scale) (device)0m Disk IO graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "nor‐ @@ -664,8 +664,8 @@ conky(1) conky(1) Displays current disk IO for reads. Device as in diskio. - 1mdiskiograph_read normal|log (device) (height),(width) (gradient colour0m - 1m1) (gradient colour 2) (scale)0m + 1mdiskiograph_read ("normal"|"log") (height),(width) (gradient colour 1)0m + 1m(gradient colour 2) (scale) (device)0m Disk IO graph for reads, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Device as in diskio. Uses a logarithmic scale (to see small numbers) when @@ -676,8 +676,8 @@ conky(1) conky(1) Displays current disk IO for writes. Device as in diskio. - 1mdiskiograph_write normal|log (device) (height),(width) (gradient colour0m - 1m1) (gradient colour 2) (scale)0m + 1mdiskiograph_write ("normal"|"log") (height),(width) (gradient colour 1)0m + 1m(gradient colour 2) (scale) (device)0m Disk IO graph for writes, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Device as in diskio. Uses a logarithmic scale (to see small numbers) @@ -697,8 +697,8 @@ conky(1) conky(1) Download speed in KiB with one decimal - 1mdownspeedgraph normal|log net (height),(width) (gradient colour 1)0m - 1m(gradient colour 2) (scale)0m + 1mdownspeedgraph ("normal"|"log") (height),(width) (gradient colour 1)0m + 1m(gradient colour 2) (scale) (net)0m Download speed graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use "log" in‐ @@ -732,7 +732,8 @@ conky(1) conky(1) bar is currently fixed, but that may change in the future. - 1mexecgraph (normal|log) command0m + 1mexecgraph ("normal"|"log") (height),(width) (gradient colour 1) (gradi‐0m + 1ment colour 2) (scale) command0m Same as execbar, but graphs values. Uses a logaritmic scale when the log option is given (to see small numbers). Values still have to be between 0 and 100. @@ -1033,8 +1034,8 @@ conky(1) conky(1) 5 minutes and 3 for past 15 minutes. - 1mloadgraph normal|log (height),(width) (gradient colour 1) (gradient0m - 1mcolour 2)0m + 1mloadgraph ("normal"|"log") (height),(width) (gradient colour 1) (gradi‐0m + 1ment colour 2) (scale)0m Load1 average graph, similar to xload, with optional colours in hex, minus the #. Uses a logarithmic scale (to see small num‐ bers) when you use "log" instead of "normal". @@ -1069,8 +1070,8 @@ conky(1) conky(1) Bar that shows amount of memory in use - 1mmemgraph normal|log (height),(width) (gradient colour 1) (gradient0m - 1mcolour 2)0m + 1mmemgraph ("normal"|"log") (height),(width) (gradient colour 1) (gradi‐0m + 1ment colour 2) (scale)0m Memory usage graph. Uses a logarithmic scale (to see small num‐ bers) when you use "log" instead of "normal". @@ -1562,8 +1563,8 @@ conky(1) conky(1) Upload speed in KiB with one decimal - 1mupspeedgraph normal|log net (height),(width) (gradient colour 1) (gra‐0m - 1mdient colour 2) (scale)0m + 1mupspeedgraph ("normal"|"log") (height),(width) (gradient colour 1)0m + 1m(gradient colour 2) (scale) (net)0m Upload speed graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use "log" in‐ diff --git a/doc/conky.1 b/doc/conky.1 index 768a29dd..6e1aac7c 100644 --- a/doc/conky.1 +++ b/doc/conky.1 @@ -584,7 +584,7 @@ CPU usage in percents. For SMP machines, the CPU number can be provided as an ar Bar that shows CPU usage, height is bar's height in pixels. See $cpu for more info on SMP. .TP -\fB\*(T<\fBcpugraph\fR\*(T>\fR \*(T<\fBnormal|log (cpu number) (height),(width) (gradient colour 1) (gradient colour 2)\fR\*(T> +\fB\*(T<\fBcpugraph\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) (cpu number)\fR\*(T> CPU usage graph, with optional colours in hex, minus the #. See $cpu for more info on SMP. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". .TP @@ -592,7 +592,7 @@ CPU usage graph, with optional colours in hex, minus the #. See $cpu for more in Displays current disk IO. Device is optional, and takes the form of sda for /dev/sda. Individual partitions are allowed. .TP -\fB\*(T<\fBdiskiograph\fR\*(T>\fR \*(T<\fBnormal|log (device) (height),(width) (gradient colour 1) (gradient colour 2) (scale)\fR\*(T> +\fB\*(T<\fBdiskiograph\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) (device)\fR\*(T> Disk IO graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". .TP @@ -600,7 +600,7 @@ Disk IO graph, colours defined in hex, minus the #. If scale is non-zero, it bec Displays current disk IO for reads. Device as in diskio. .TP -\fB\*(T<\fBdiskiograph_read\fR\*(T>\fR \*(T<\fBnormal|log (device) (height),(width) (gradient colour 1) (gradient colour 2) (scale)\fR\*(T> +\fB\*(T<\fBdiskiograph_read\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) (device)\fR\*(T> Disk IO graph for reads, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Device as in diskio. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". .TP @@ -608,7 +608,7 @@ Disk IO graph for reads, colours defined in hex, minus the #. If scale is non-ze Displays current disk IO for writes. Device as in diskio. .TP -\fB\*(T<\fBdiskiograph_write\fR\*(T>\fR \*(T<\fBnormal|log (device) (height),(width) (gradient colour 1) (gradient colour 2) (scale)\fR\*(T> +\fB\*(T<\fBdiskiograph_write\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) (device)\fR\*(T> Disk IO graph for writes, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Device as in diskio. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". .TP @@ -624,7 +624,7 @@ Download speed in KiB Download speed in KiB with one decimal .TP -\fB\*(T<\fBdownspeedgraph\fR\*(T>\fR \*(T<\fBnormal|log net (height),(width) (gradient colour 1) (gradient colour 2) (scale)\fR\*(T> +\fB\*(T<\fBdownspeedgraph\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) (net)\fR\*(T> Download speed graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". .TP @@ -652,7 +652,7 @@ Executes a shell command and displays the output in conky. warning: this takes a Same as exec, except if the first value return is a value between 0-100, it will use that number for a bar. The size for the bar is currently fixed, but that may change in the future. .TP -\fB\*(T<\fBexecgraph\fR\*(T>\fR \*(T<\fB(normal|log) command\fR\*(T> +\fB\*(T<\fBexecgraph\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) command\fR\*(T> Same as execbar, but graphs values. Uses a logaritmic scale when the log option is given (to see small numbers). Values still have to be between 0 and 100. .TP @@ -874,7 +874,7 @@ The value of /proc/sys/vm/laptop_mode (1,2,3)> System load average, 1 is for past 1 minute, 2 for past 5 minutes and 3 for past 15 minutes. .TP -\fB\*(T<\fBloadgraph\fR\*(T>\fR \*(T<\fBnormal|log (height),(width) (gradient colour 1) (gradient colour 2)\fR\*(T> +\fB\*(T<\fBloadgraph\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale)\fR\*(T> Load1 average graph, similar to xload, with optional colours in hex, minus the #. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". .TP @@ -905,7 +905,7 @@ Amount of memory in use Bar that shows amount of memory in use .TP -\fB\*(T<\fBmemgraph\fR\*(T>\fR \*(T<\fBnormal|log (height),(width) (gradient colour 1) (gradient colour 2)\fR\*(T> +\fB\*(T<\fBmemgraph\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale)\fR\*(T> Memory usage graph. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". .TP @@ -1363,7 +1363,7 @@ Upload speed in KiB Upload speed in KiB with one decimal .TP -\fB\*(T<\fBupspeedgraph\fR\*(T>\fR \*(T<\fBnormal|log net (height),(width) (gradient colour 1) (gradient colour 2) (scale)\fR\*(T> +\fB\*(T<\fBupspeedgraph\fR\*(T>\fR \*(T<\fB("normal"|"log") (height),(width) (gradient colour 1) (gradient colour 2) (scale) (net)\fR\*(T> Upload speed graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". .TP diff --git a/doc/variables.xml b/doc/variables.xml index b3d03329..c0b16af9 100644 --- a/doc/variables.xml +++ b/doc/variables.xml @@ -420,7 +420,7 @@ - + CPU usage graph, with optional colours in hex, minus the #. See $cpu for more info on SMP. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". @@ -440,7 +440,7 @@ - + Disk IO graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". @@ -460,7 +460,7 @@ - + Disk IO graph for reads, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Device as in diskio. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". @@ -480,7 +480,7 @@ - + Disk IO graph for writes, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Device as in diskio. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". @@ -520,7 +520,7 @@ - + Download speed graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". @@ -587,7 +587,7 @@ - + Same as execbar, but graphs values. Uses a logaritmic scale when the log option is given (to see small numbers). Values still have to be between 0 and 100. @@ -1123,7 +1123,7 @@ - + Load1 average graph, similar to xload, with optional colours in hex, minus the #. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". @@ -1195,7 +1195,7 @@ - + Memory usage graph. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". @@ -2104,7 +2104,7 @@ - + Upload speed graph, colours defined in hex, minus the #. If scale is non-zero, it becomes the scale for the graph. Uses a logarithmic scale (to see small numbers) when you use "log" instead of "normal". diff --git a/src/conky.c b/src/conky.c index b87c2499..2a9e4b63 100644 --- a/src/conky.c +++ b/src/conky.c @@ -909,6 +909,7 @@ static char *scan_graph(const char *args, int *w, int *h, *showaslog = FALSE; nographtype = args; } + DBGP("printing graph as %s, other args are: %s", (*showaslog ? "log" : "normal"), nographtype); //check the rest of the args if (sscanf(nographtype, "%d,%d %x %x %u", h, w, first_colour, last_colour, scale) == 5) { return NULL; @@ -1892,24 +1893,24 @@ static struct text_object *construct_text_object(const char *s, END OBJ(diskio_write, INFO_DISKIO) obj->data.diskio = prepare_diskio_stat(dev_name(arg)); END OBJ(diskiograph, INFO_DISKIO) - char *buf = scan_graph(dev_name(arg), &obj->a, &obj->b, &obj->c, &obj->d, + char *buf = scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d, &obj->e, &obj->showaslog); - obj->data.diskio = prepare_diskio_stat(buf); + obj->data.diskio = prepare_diskio_stat(dev_name(buf)); if (buf) free(buf); END OBJ(diskiograph_read, INFO_DISKIO) - char *buf = scan_graph(dev_name(arg), &obj->a, &obj->b, &obj->c, &obj->d, + char *buf = scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d, &obj->e, &obj->showaslog); - obj->data.diskio = prepare_diskio_stat(buf); + obj->data.diskio = prepare_diskio_stat(dev_name(buf)); if (buf) free(buf); END OBJ(diskiograph_write, INFO_DISKIO) - char *buf = scan_graph(dev_name(arg), &obj->a, &obj->b, &obj->c, &obj->d, + char *buf = scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d, &obj->e, &obj->showaslog); - obj->data.diskio = prepare_diskio_stat(buf); + obj->data.diskio = prepare_diskio_stat(dev_name(buf)); if (buf) free(buf); #endif