downspeedgraph net, (height),(width) (gradient colour 1) (gradient
- colour 2)
- Download speed graph, colours defined in hex, minus the #.
+ colour 2) (scale)
+ Download speed graph, colours defined in hex, minus the #. If
+ scale is non-zero, it becomes the scale for the graph.
else Text to show if any of the above are not true
exec command
Executes a shell command and displays the output in conky. warn-
- ing: this takes a lot more resources than other variables. I'd
+ ing: this takes a lot more resources than other variables. I'd
recommend coding wanted behaviour in C and posting a patch.
execbar command
- 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
+ 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.
execgraph command
- Same as execbar, but graphs values
+ Same as execbar, but graphs values.
execi interval command
- Same as exec but with specific interval. Interval can't be less
+ Same as exec but with specific interval. Interval can't be less
than update_interval in configuration.
fs_bar (height),(width) fs
- Bar that shows how much space is used on a file system. height
+ Bar that shows how much space is used on a file system. height
is the height in pixels. fs is any file on that file system.
i2c (dev), type, n
- I2C sensor from sysfs (Linux 2.6). dev may be omitted if you
- have only one I2C device. type is either in (or vol) meaning
+ I2C sensor from sysfs (Linux 2.6). dev may be omitted if you
+ have only one I2C device. type is either in (or vol) meaning
voltage, fan meaning fan or temp/tempf (first in C, second in F)
- meaning temperature. n is number of the sensor. See
+ meaning temperature. n is number of the sensor. See
/sys/bus/i2c/devices/ on your local computer.
if_running (process)
- if PROCESS is running, display everything if_running and the
+ if PROCESS is running, display everything if_running and the
matching $endif
if_existing (file)
- if FILE exists, display everything between if_existing and the
+ if FILE exists, display everything between if_existing and the
matching $endif
if_mounted (mountpoint)
- if MOUNTPOINT is mounted, display everything between if_mounted
+ if MOUNTPOINT is mounted, display everything between if_mounted
and the matching $endif
Machine, i686 for example
- mails Mail count in mail spool. You can use program like fetchmail to
- get mails from some server using your favourite protocol. See
+ mails Mail count in mail spool. You can use program like fetchmail to
+ get mails from some server using your favourite protocol. See
also new_mails.
Move text over by N pixels. See also $voffset.
- tail logfile, lines interval> Displays last N lines of supplied text
+ tail logfile, lines interval> Displays last N lines of supplied text
text file. If interval is not supplied, Conky assumes 2x Conky's
interval. Max of 30 lines. Max of 30 lines can be displayed.
time (format)
- Local time, see man strftime to get more information about for-
+ Local time, see man strftime to get more information about for-
mat
totaldown net
- Total download, overflows at 4 GB on Linux with 32-bit arch and
- there doesn't seem to be a way to know how many times it has
+ Total download, overflows at 4 GB on Linux with 32-bit arch and
+ there doesn't seem to be a way to know how many times it has
already done that before conky has started.
top type, num
- This takes arguments in the form:top (name) (number) Basically,
- processes are ranked from highest to lowest in terms of cpu
- usage, which is what (num) represents. The types are: "name",
- "pid", "cpu", and mem". There can be a max of 10 processes
+ This takes arguments in the form:top (name) (number) Basically,
+ processes are ranked from highest to lowest in terms of cpu
+ usage, which is what (num) represents. The types are: "name",
+ "pid", "cpu", and mem". There can be a max of 10 processes
listed.
upspeedgraph net, (height),(width) (gradient colour 1) (gradient colour
- 2)
- Upload speed graph, colours defined in hex, minus the #.
+ 2) (scale)
+ Upload speed graph, colours defined in hex, minus the #. If
+ scale is non-zero, it becomes the scale for the graph.
uptime Uptime
inline void graph_append(struct special_t *graph, double f)
{
+ if (!graph->scaled && f > graph->graph_scale) {
+ f = graph->graph_scale;
+ }
int i;
if (graph->scaled) {
graph->graph_scale = 0;
}
}
-static void new_graph(char *buf, int w, int h, unsigned int first_colour, unsigned int second_colour, double i, int scaled, int append)
+static void new_graph(char *buf, int w, int h, unsigned int first_colour, unsigned int second_colour, double i, int scale, int append)
{
struct special_t *s = new_special(buf, GRAPH);
s->width = w;
s->height = h;
s->first_colour = first_colour;
s->last_colour = second_colour;
- s->scaled = scaled;
+ if (scale != 0) {
+ s->scaled = 0;
+ } else {
+ s->scaled = 1;
+ }
if (s->width) {
s->graph_width = s->width - 3; // subtract 3 for rectangle around
}
- if (scaled) {
+ if (s->scaled) {
s->graph_scale = 1;
} else {
- s->graph_scale = 100;
+ s->graph_scale = scale;
}
if (append) {
graph_append(s, i);
}
}
-static const char *scan_graph(const char *args, int *w, int *h, unsigned int *first_colour, unsigned int *last_colour)
+static const char *scan_graph(const char *args, int *w, int *h, unsigned int *first_colour, unsigned int *last_colour, unsigned int *scale)
{
*w = 0; /* zero width means all space that is available */
*h = 25;
*last_colour = 0;
/* graph's argument is either height or height,width */
if (args) {
- if (sscanf(args, "%*s %d,%d %x %x", h, w, first_colour, last_colour) < 4) {
- if (sscanf(args, "%d,%d %x %x", h, w, first_colour, last_colour) < 4) {
- *w = 0;
+ if (sscanf(args, "%*s %d,%d %x %x %i", h, w, first_colour, last_colour, scale) < 5) {
+ if (sscanf(args, "%*s %d,%d %x %x", h, w, first_colour, last_colour) < 4) {
+ *scale = 0;
+ if (sscanf(args, "%d,%d %x %x %i", h, w, first_colour, last_colour, scale) < 5) {
+ *scale = 0;
+ if (sscanf(args, "%d,%d %x %x", h, w, first_colour, last_colour) < 4) {
+ *w = 0;
*h = 25;
if (sscanf(args, "%*s %x %x", first_colour, last_colour) < 3) {
*w = 0;
*last_colour = 0;
sscanf(args, "%*s %d,%d", h, w);
}
- }
+ }}
+ }
}
}
}
}
+ printf("scale is %i\n", *scale);
return args;
}
struct text_object {
int type;
int a, b;
- unsigned int c, d;
+ unsigned int c, d, e;
union {
char *s; /* some string */
int i; /* some integer */
END OBJ(cpubar, INFO_CPU)
(void) scan_bar(arg, &obj->data.pair.a, &obj->data.pair.b);
END OBJ(cpugraph, INFO_CPU)
- (void) scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d);
+ (void) scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d, &obj->e);
END OBJ(color, 0)
#ifdef X11
obj->data.l = arg ? get_x11_color(arg) : default_fg_color;
OBJ(downspeed, INFO_NET) obj->data.net = get_net_stat(arg);
END OBJ(downspeedf, INFO_NET) obj->data.net = get_net_stat(arg);
END OBJ(downspeedgraph, INFO_NET)
- (void) scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d);
+ (void) scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d, &obj->e);
char buf[64];
sscanf(arg, "%63s %*i,%*i %*i", buf);
obj->data.net = get_net_stat(buf);
END OBJ(membar, INFO_MEM)
(void) scan_bar(arg, &obj->data.pair.a, &obj->data.pair.b);
END OBJ(memgraph, INFO_MEM)
- (void) scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d);
+ (void) scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d, &obj->e);
END OBJ(mixer, INFO_MIXER) obj->data.l = mixer_init(arg);
END OBJ(mixerl, INFO_MIXER) obj->data.l = mixer_init(arg);
END OBJ(mixerr, INFO_MIXER) obj->data.l = mixer_init(arg);
END OBJ(upspeed, INFO_NET) obj->data.net = get_net_stat(arg);
END OBJ(upspeedf, INFO_NET) obj->data.net = get_net_stat(arg);
END OBJ(upspeedgraph, INFO_NET)
- (void) scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d);
+ (void) scan_graph(arg, &obj->a, &obj->b, &obj->c, &obj->d, &obj->e);
char buf[64];
sscanf(arg, "%63s %*i,%*i %*i", buf);
obj->data.net = get_net_stat(buf);
new_graph(p, obj->a,
obj->b, obj->c, obj->d,
(unsigned int) (cur->cpu_usage *
- 100), 0, 1);
+ 100), 100, 1);
}
OBJ(color) {
new_fg(p, obj->data.l);
obj->data.net->recv_speed = 0.01;
new_graph(p, obj->a, obj->b, obj->c, obj->d,
(obj->data.net->recv_speed /
- 1024.0), 1, 1);
+ 1024.0), obj->e, 1);
}
OBJ(
else
ERR("your execgraph value is not between 0 and 100, therefore it will be ignored");
} else {
new_graph(p, 0,
- 25, obj->c, obj->d, (int) (barnum), 0, 1);
+ 25, obj->c, obj->d, (int) (barnum), obj->e, 1);
}
}
}
OBJ(execigraph) {
if (current_update_time - obj->data.execi.last_update < obj->data.execi.interval) {
- new_graph(p, 0, 25, obj->c, obj->d, (int) (obj->data.execi.data), 0, 0);
+ new_graph(p, 0, 25, obj->c, obj->d, (int) (obj->data.execi.data), obj->e, 0);
} else {
char *p2 = p;
FILE *fp = popen(obj->data.s, "r");
ERR("your execigraph value is not between 0 and 100, therefore it will be ignored");
} else {
obj->data.execi.data = barnum;
- new_graph(p, 0, 25, obj->c, obj->d, (int) (obj->data.execi.data), 0, 1);
+ new_graph(p, 0, 25, obj->c, obj->d, (int) (obj->data.execi.data), obj->e, 1);
}
obj->data.execi.last_update = current_update_time;
new_graph(p, obj->a,
obj->b, obj->c, obj->d,
cur->memmax ? (cur->mem * 100.0) /
- (cur->memmax) : 0.0, 0, 1);
+ (cur->memmax) : 0.0, 100, 1);
}
/* mixer stuff */
OBJ(mixer) {
obj->data.net->trans_speed = 0.01;
new_graph(p, obj->a, obj->b, obj->c, obj->d,
(obj->data.net->trans_speed /
- 1024.0), 1, 1);
+ 1024.0), obj->e, 1);
}
OBJ(uptime_short) {
format_seconds_short(p, n,