You are not logged in.
Pages: 1
I have the following lines in my conkyrc so that it checks the weather for my location. However, if my internet is down, it will break Conky. Does anyone know a way I can do something like "if(internet==true)" and put the lines within that?
${execi 120 wget -nc -P/tmp http://www.weather.gov/data/current_obs/KLEX.xml 2> /dev/null}
${color 808080}temperature: ${color}${execi 120 grep -e "<temp_c>" /tmp/KLEX.xml | \
sed 's/^[ \t]*//' | sed -e 's/<[^>]*>//g'} °C
${color 808080}pressure: ${color}${execi 120 grep -e "<pressure_mb>" /tmp/KLEX.xml | \
sed 's/^[ \t]*//' | sed -e 's/<[^>]*>//g'} mb
${color 808080}humidity: ${color}${execi 120 grep -e "<relative_humidity>" /tmp/KLEX.xml | \
sed 's/^[ \t]*//' | sed -e 's/<[^>]*>//g'}%
Offline
Write a script with appropriate error handling so that it either generates the needed output or no output then call it from conky.
Offline
Ahh; thanks. That makes sense. Well as you can see, I am calling the bash functions inside the conky script rather than making conky point to a shell script somewhere else to do the work. I guess I need to change that wget function so that if it cannot execute, it produces a blank xml file... Does anyone know how to do that?
Offline
I don't think there is any other way then to just let a separate script handle it. As far as I know conky doesn't have conditional statements (last i checked anyway) and no option like that exists for wget that I know of. Why don't you want to just right like a weather-output script or something?
Offline
Pages: 1