1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 10:35:10 +00:00

feat: make gw_iface work with downspeedgraph & upspeedgraph, e.g. ${downspeedgraph ${gw_iface}}

This commit is contained in:
Steven Xu 2021-05-17 19:12:22 +10:00 committed by Brenden Matthews
parent ead54f4f73
commit 0498e6a433

View File

@ -335,6 +335,14 @@ void parse_net_stat_graph_arg(struct text_object *obj, const char *arg,
// default to DEFAULTNETDEV
if (buf != nullptr) {
#if defined(__linux__)
if (0 == (strcmp("$gw_iface", buf)) || 0 == (strcmp("${gw_iface}", buf))) {
update_gateway_info();
obj->data.opaque = get_net_stat(e_iface, obj, free_at_crash);
free(buf);
return;
}
#endif
obj->data.opaque = get_net_stat(buf, obj, free_at_crash);
free(buf);
return;