diff --git a/src/conky.c b/src/conky.c index 11717cd5..a82a1bad 100644 --- a/src/conky.c +++ b/src/conky.c @@ -896,13 +896,6 @@ void generate_text_internal(char *p, int p_max_size, new_graph(obj, p, p_max_size, round_to_int(cur->cpu_usage[obj->data.i] * 100)); } #endif /* X11 */ -#if defined(__linux__) - OBJ(if_gw) { - if (!gateway_exists()) { - DO_JUMP; - } - } -#endif /* __linux__ */ #if (defined(__FreeBSD__) || defined(__linux__)) OBJ(if_up) { if (!interface_up(obj)) { diff --git a/src/core.c b/src/core.c index ccb8c1f6..437471bd 100644 --- a/src/core.c +++ b/src/core.c @@ -333,6 +333,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long END OBJ(sony_fanspeed, 0) obj->callbacks.print = &get_sony_fanspeed; END OBJ_IF(if_gw, &update_gateway_info) + obj->callbacks.iftest = &gateway_exists; END OBJ_ARG(ioscheduler, 0, "get_ioscheduler needs an argument (e.g. hda)") obj->data.s = strndup(dev_name(arg), text_buffer_size); obj->callbacks.print = &print_ioscheduler; diff --git a/src/linux.c b/src/linux.c index ca82c36c..b00225a3 100644 --- a/src/linux.c +++ b/src/linux.c @@ -316,8 +316,9 @@ void free_gateway_info(void) memset(&gw_info, 0, sizeof(gw_info)); } -int gateway_exists(void) +int gateway_exists(struct text_object *obj) { + (void)obj; return !!gw_info.count; } diff --git a/src/linux.h b/src/linux.h index 6d64b80a..2e4ac2cb 100644 --- a/src/linux.h +++ b/src/linux.h @@ -12,7 +12,7 @@ void print_laptop_mode(struct text_object *, char *, int); void update_gateway_info(void); void free_gateway_info(void); -int gateway_exists(void); +int gateway_exists(struct text_object *); void print_gateway_iface(struct text_object *, char *, int); void print_gateway_ip(struct text_object *, char *, int);