diff --git a/src/common.c b/src/common.c index 5b6e90cc..f8f24e4c 100644 --- a/src/common.c +++ b/src/common.c @@ -601,3 +601,8 @@ void print_cached(struct text_object *obj, char *p, int p_max_size) (void)obj; human_readable(info.cached * 1024, p, p_max_size); } + +void print_evaluate(struct text_object *obj, char *p, int p_max_size) +{ + evaluate(obj->data.s, p, p_max_size); +} diff --git a/src/common.h b/src/common.h index 779332b2..ae957be1 100644 --- a/src/common.h +++ b/src/common.h @@ -102,4 +102,6 @@ void print_threads(struct text_object *, char *, int); void print_buffers(struct text_object *, char *, int); void print_cached(struct text_object *, char *, int); +void print_evaluate(struct text_object *, char *, int); + #endif /* _COMMON_H */ diff --git a/src/conky.c b/src/conky.c index 6ba9feac..2b9dd8ed 100644 --- a/src/conky.c +++ b/src/conky.c @@ -889,9 +889,6 @@ void generate_text_internal(char *p, int p_max_size, cimlib_add_image(obj->data.s); } #endif /* IMLIB2 */ - OBJ(eval) { - evaluate(obj->data.s, p, p_max_size); - } OBJ(if_empty) { char buf[max_user_text]; struct information *tmp_info = diff --git a/src/core.c b/src/core.c index 863260fc..0c2ce224 100644 --- a/src/core.c +++ b/src/core.c @@ -536,6 +536,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long obj_be_ifblock_endif(ifblock_opaque, obj); END OBJ(eval, 0) obj->data.s = strndup(arg ? arg : "", text_buffer_size); + obj->callbacks.print = &print_evaluate; obj->callbacks.free = &gen_free_opaque; #if defined(IMLIB2) && defined(X11) END OBJ(image, 0)