need conky help

Hello folks. for the life of me i cant figure out this conky program,

i have everything set except one aspect.

i want something to display either “online” or “offline” depending on the network status.
so basically if it detects network connection then it displays the word “online”
if not then it displays “offline”

anybody got any ideas on this? also it has to be both capable with wireless or ethernet

Could you please at least tell which version of openSUSE you use?

And a positive identification of yoour desktop environment (and version) is also nice.

oh shoot sorry,

im useing 13.1 and KDE4

Hi
You probably need to set the if_up_strictness (see http://conky.sourceforge.net/config_settings.html)

So in your config before TEXT add;


if_up_strictness link

Then after TEXT add something like;


${if_existing /proc/net/route enp4s0}Ethernet: ONLINE
${else}
${if_existing /proc/net/route wlo1}Wireless: ONLINE
${else} OFFLINE
${endif}

Note those are my two interface, you need to modify as required from /sbin/ifconfig

Hello malcolmlewis,

thanks for the reply. this appears to work good if there is only 1 adapter present. unfortunately the computers will have 2 adapters present but only one connecting wither its wireless or wired. if it detects the ethernet is present but not connecting it reports offline even if wireless is working. any way around this? and unfortunately the wireless adapters will be different names as well im assuming because this will be put on diffent tyles of machines IE dell, lenovo, hp…is there a way to just get around all this?

On Thu 23 Oct 2014 08:36:01 PM CDT, rady wrote:

malcolmlewis;2670883 Wrote:
> Hi
> You probably need to set the if_up_strictness (see
> Configuration Settings)
>
> So in your config before TEXT add;
> >
Code:

> >
> if_up_strictness link
>

> >
> Then after TEXT add something like;
> >
Code:

> >
> ${if_existing /proc/net/route enp4s0}Ethernet: ONLINE
> ${else}
> ${if_existing /proc/net/route wlo1}Wireless: ONLINE
> ${else} OFFLINE
> ${endif}
>

> >
> Note those are my two interface, you need to modify as required from
> /sbin/ifconfig

Hello malcolmlewis,

thanks for the reply. this appears to work good if there is only 1
adapter present. unfortunately the computers will have 2 adapters
present but only one connecting wither its wireless or wired. if it
detects the ethernet is present but not connecting it reports offline
even if wireless is working. any way around this? and unfortunately the
wireless adapters will be different names as well im assuming because
this will be put on diffent tyles of machines IE dell, lenovo, hp…is
there a way to just get around all this?

Hi
Change the ‘link’ to ‘address’, see the reference link :wink:

I tested here with ethernet and wireless (as in two adapters), I’m
guessing the change to address should fix it.

You could also try if_up.

You can configure the system back to the old naming method eg eth0 and
wlan0 if required.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.1 Kernel 3.11.10-21-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!