diff --git a/src/common.c b/src/common.c index 3c65f52b..edf1ac23 100644 --- a/src/common.c +++ b/src/common.c @@ -466,6 +466,9 @@ void scan_loadgraph_arg(struct text_object *obj, const char *arg) void print_loadgraph(struct text_object *obj, char *p, int p_max_size) { + if (!p_max_size) + return; + new_graph(obj, p, p_max_size, info.loadavg[0]); } #endif /* X11 */ diff --git a/src/conky.c b/src/conky.c index 1b5afc6e..eccd8b01 100644 --- a/src/conky.c +++ b/src/conky.c @@ -895,9 +895,6 @@ void generate_text_internal(char *p, int p_max_size, OBJ(cpugraph) { new_graph(obj, p, p_max_size, round_to_int(cur->cpu_usage[obj->data.i] * 100)); } - OBJ(loadgraph) { - print_loadgraph(obj, p, p_max_size); - } #endif /* X11 */ #if defined(__linux__) OBJ(disk_protect) { diff --git a/src/core.c b/src/core.c index f848267a..890d4861 100644 --- a/src/core.c +++ b/src/core.c @@ -394,6 +394,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long if (buf) free(buf); END OBJ(loadgraph, &update_load_average) scan_loadgraph_arg(obj, arg); + obj->callbacks.print = &print_loadgraph; #endif /* X11 */ END OBJ(diskio, &update_diskio) parse_diskio_arg(obj, arg);