diff --git a/doc/variables.xml b/doc/variables.xml index a15b8c44..d82f329d 100644 --- a/doc/variables.xml +++ b/doc/variables.xml @@ -31,7 +31,7 @@ - + IP address for an interface, or "No Address" if no address is assigned. @@ -42,7 +42,7 @@ - + IP addresses for an interface (if one - works like addr). Linux only. @@ -745,7 +745,7 @@ - + Download speed in KiB @@ -755,7 +755,7 @@ - + Download speed in KiB with one decimal @@ -2929,7 +2929,7 @@ - + Total download, overflows at 4 GB on Linux with 32-bit arch and there doesn't seem to be a way to know how @@ -2942,7 +2942,7 @@ - + Total upload, this one too, may overflow @@ -3041,7 +3041,7 @@ - + Upload speed in KiB @@ -3051,7 +3051,7 @@ - + Upload speed in KiB with one decimal @@ -3176,7 +3176,7 @@ - + Wireless access point MAC address (Linux only) @@ -3186,7 +3186,7 @@ - + Wireless bitrate (ie 11 Mb/s) (Linux only) @@ -3196,7 +3196,7 @@ - + Wireless access point ESSID (Linux only) @@ -3206,7 +3206,7 @@ - + Wireless link quality bar (Linux only) @@ -3216,7 +3216,7 @@ - + Wireless link quality (Linux only) @@ -3226,7 +3226,7 @@ - + Wireless link quality maximum value (Linux only) @@ -3236,7 +3236,7 @@ - + Wireless link quality in percents (Linux only) @@ -3246,7 +3246,7 @@ - + Wireless mode (Managed/Ad-Hoc/Master) (Linux only) diff --git a/src/conky.c b/src/conky.c index 6ba467d2..1792277e 100644 --- a/src/conky.c +++ b/src/conky.c @@ -1267,43 +1267,64 @@ static struct text_object *construct_text_object(const char *s, if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("wireless_essid: needs an argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(wireless_mode, INFO_NET) if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("wireless_mode: needs an argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(wireless_bitrate, INFO_NET) if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("wireless_bitrate: needs an argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(wireless_ap, INFO_NET) if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("wireless_ap: needs an argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(wireless_link_qual, INFO_NET) if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("wireless_link_qual: needs an argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(wireless_link_qual_max, INFO_NET) if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("wireless_link_qual_max: needs an argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(wireless_link_qual_perc, INFO_NET) if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("wireless_link_qual_perc: needs an argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(wireless_link_bar, INFO_NET) SIZE_DEFAULTS(bar); @@ -1311,7 +1332,10 @@ static struct text_object *construct_text_object(const char *s, arg = scan_bar(arg, &obj->a, &obj->b); obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("wireless_link_bar: needs an argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } #endif /* HAVE_IWLIB */ @@ -1586,13 +1610,19 @@ static struct text_object *construct_text_object(const char *s, if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("downspeed needs argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(downspeedf, INFO_NET) if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("downspeedf needs argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } #ifdef X11 END OBJ(downspeedgraph, INFO_NET) @@ -1927,14 +1957,20 @@ static struct text_object *construct_text_object(const char *s, if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("addr needs argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } #if defined(__linux__) END OBJ(addrs, INFO_NET) if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("addrs needs argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } #endif /* __linux__ */ END OBJ(tail, 0) @@ -2387,14 +2423,20 @@ static struct text_object *construct_text_object(const char *s, if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("totaldown needs argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(totalup, INFO_NET) obj->data.net = get_net_stat(arg); if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("totalup needs argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(updates, 0) END OBJ_IF(if_updatenr, 0) @@ -2409,13 +2451,19 @@ static struct text_object *construct_text_object(const char *s, if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("upspeed needs argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } END OBJ(upspeedf, INFO_NET) if (arg) { obj->data.net = get_net_stat(arg); } else { - CRIT_ERR("upspeedf needs argument"); + // default to DEFAULTNETDEV + char *buf = strndup(DEFAULTNETDEV, text_buffer_size); + obj->data.net = get_net_stat(buf); + free(buf); } #ifdef X11