You are not logged in.

#1 2009-07-05 11:39:41

LonelyStar
Member
Registered: 2007-12-09
Posts: 123

Conky having a variable twice

Hi,

If I have a conkye "TEXT" section like this:

${if_empty ${wireless_essid wlan0}}
NO_WLAN
${else}
${wireless_essid wlan0}
${endif}

will conky evaluate the "${wireless_essid wlan0}" twice?
If so, can I avoid this?

Thanks!
Nathan

Offline

#2 2009-07-05 15:44:45

Zepp
Member
From: Ontario, Canada
Registered: 2006-03-25
Posts: 334
Website

Re: Conky having a variable twice

This really depends on how conky is implemented. If I had to I'd assume yes, but I have never looked at its source code. Anyway, it wouldn't be something you can avoid without a patch/hacks.

Offline

#3 2009-07-05 16:12:28

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: Conky having a variable twice

LonelyStar wrote:

Hi,

If I have a conkye "TEXT" section like this:

${if_empty ${wireless_essid wlan0}}
NO_WLAN
${else}
${wireless_essid wlan0}
${endif}

will conky evaluate the "${wireless_essid wlan0}" twice?
If so, can I avoid this?

Thanks!
Nathan

What are you exactly trying to do?
If you just want to check network interfaces this snippet from my .conkyrc may be useful:

${if_gw}
${if_existing /proc/net/route wlan0}
${execpi 10800 conkyForecast -t ~/.scripts/conkyForecast.template}${endif}
${if_existing /proc/net/route eth0}
${execpi 10800 conkyForecast -t ~/.script /conkyForecast.template}${endif}
${else}
${voffset 4} Weather Unavailable${endif}

Last edited by arkham (2009-07-05 16:13:48)


"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#4 2009-07-05 16:52:02

LonelyStar
Member
Registered: 2007-12-09
Posts: 123

Re: Conky having a variable twice

Hi,

I am trying to check if wlan0 is connected to an essid.
As far as i can see, your code checks if  wlan0 is up.

Offline

#5 2009-07-05 17:00:53

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: Conky having a variable twice

LonelyStar wrote:

Hi,

I am trying to check if wlan0 is connected to an essid.
As far as i can see, your code checks if  wlan0 is up.

My code checks if wlan0 / eth0 have a route, i.e. they have an IP address and a default GW.


"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#6 2009-07-05 17:40:16

LonelyStar
Member
Registered: 2007-12-09
Posts: 123

Re: Conky having a variable twice

arkham wrote:

My code checks if wlan0 / eth0 have a route, i.e. they have an IP address and a default GW.

That makes sense ... thanks!

Offline

Board footer

Powered by FluxBB