You are not logged in.

#1 2015-07-17 17:49:24

HDArtworks
Member
Registered: 2015-04-20
Posts: 60
Website

How to change weather in conky to my place?

Hi.
Today i install conky and i run a conky with weather conky.
I see in the conkyrc file. And i see for weather check it use weather.xml in .cache folder.
I open weather.xml with gedit. And i don't know how to change city to my city.
And when i edit that file and save. But again it's get back to default!
I check this link also. But i don't know how to use it in my conkyrc.
https://bbs.archlinux.org/viewtopic.php?id=37381

So, How can i add my city to weather conky?
Here is my conkyrc file.

# Conky settings #
background yes
update_interval 1
double_buffer yes
no_buffers yes
imlib_cache_size 10

# Window specifications #
gap_x -20
gap_y 90
minimum_size 268 620
maximum_width 268
own_window yes
own_window_type desktop  # other options are: override/dock/desktop/panel
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
border_inner_margin 0
border_outer_margin 0
#alignment middle_middle
own_window_argb_visual yes
own_window_argb_value 0

# Graphics settings #
draw_shades no
default_shade_color AAAAAA
draw_outline no
default_outline_color AAAAAA
draw_borders no
draw_graph_borders no
default_graph_size 26 80
show_graph_scale no
show_graph_range no

# Text settings #
use_xft yes
xftalpha 0
xftfont Droid Sans:size=8
text_buffer_size 256
override_utf8_locale yes

# Useful shortenings #
short_units yes
pad_percents 2
top_name_width 7

# Color scheme #
default_color DCDCDC
color1 DCDCDC
color2 DCDCDC
color3 DCDCDC
color4 F9F9F9
color5 D64937
color6 888888
color7 484848
color8 2D2D2D

TEXT
# Various images #
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=44418&u=c" -o ~/.cache/weather.xml}
${image ~/.harmattan-assets/misc/Numix/God-Mode/top-bg.png -p 20,30 -s 228x61}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/bottom-bg.png -p 20,473 -s 228x119}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/border.png -p 20,91 -s 228x86}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/fav-color.png -p 20,91 -s 228x86}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/bg-1.png -p 20,177 -s 228x86}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/bg-2.png -p 20,263 -s 228x105}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/bg-3.png -p 20,368 -s 228x105}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/bg-4.png -p 20,478 -s 228x14}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/separator-v.png -p 95,185 -s 1x76}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/separator-v.png -p 172,185 -s 1x76}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/separator-h.png -p 33,369 -s 202x1}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/separator-h.png -p 33,269 -s 202x1}\
\
# The days of the forecast #
\
${color3}${voffset 172}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${color}
\
# The temperatures of the forecast #
\
${color2}${voffset 51}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${color2}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
${color2}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
\
# The "conditions" section of the conky #
\
${goto 36}${voffset -172}${font Droid Sans :size=36}${color4}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${color}
${goto 46}${voffset 14}${font Droid Sans :size=12}${color4}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}${color}
${color1}${alignr 52}${voffset -73}${execi 300 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "pressure=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} ${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "pressure=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}
${color1}${alignr 52}${voffset 7}${execi 300 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} %${color}
${color1}${alignr 52}${voffset 7}${execi 300 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} ${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
\
# Clock + calendar #
\
${voffset -117}${font Droid Sans Mono :size=22}${alignc}${color2}${time %H:%M}${font}${color}
${voffset 4}${font Droid Sans :size=10}${alignc}${color6}${time %A, %B %d}${font}${color}
\
# Cpu, memory, uptime, and load graph #
\
${voffset 294}${goto 40}${color5}Cpu:${color}
${voffset 4}${goto 40}${color5}Mem:${color}
${voffset 4}${goto 40}${color5}Uptime:${color}
${voffset -47}${alignr 39}${color6}${cpu cpu0}%${color}
${voffset 4}${alignr 39}${color6}${memperc}%${color}
${voffset 4}${alignr 39}${color6}${uptime_short}${color}
${voffset -47}${alignc}${color2}${cpubar 5,36}${color}
${voffset 4}${alignc}${color2}${membar 5,36}${color}
${voffset 29}${goto 40}${loadgraph 26,190 D64937 D64937 -l}
\
# The processes section #
\
${voffset 26}${goto 40}${color5}${top_mem name 1}${color}
${voffset 4}${goto 40}${color5}${top_mem name 2}${color}
${voffset 4}${goto 40}${color5}${top_mem name 3}${color}
${voffset 4}${goto 40}${color5}${top_mem name 4}${color}
${voffset 4}${goto 40}${color5}${top_mem name 5}${color}
${voffset -81}${alignc}${color2}${top_mem mem 1}%${color}
${voffset 4}${alignc}${color2}${top_mem mem 2}%${color}
${voffset 4}${alignc}${color2}${top_mem mem 3}%${color}
${voffset 4}${alignc}${color2}${top_mem mem 4}%${color}
${voffset 4}${alignc}${color2}${top_mem mem 5}%${color}
${voffset -81}${alignr 39}${color6}${top_mem mem_res 1}${color}
${voffset 4}${alignr 39}${color6}${top_mem mem_res 2}${color}
${voffset 4}${alignr 39}${color6}${top_mem mem_res 3}${color}
${voffset 4}${alignr 39}${color6}${top_mem mem_res 4}${color}
${voffset 4}${alignr 39}${color6}${top_mem mem_res 5}${color}
${voffset -104}${goto 40}${color1}Proc${color}
${voffset -13}${alignc}${color1}Mem%${color}
${voffset -13}${alignr 39}${color1}Mem${color}
\
# The network section #
\
${if_existing /proc/net/route ppp0}
${voffset -227}${goto 40}${color5}Up: ${color2}${upspeed ppp0}${color5}${goto 150}Down: ${color2}${downspeed ppp0}
${voffset 10}${goto 40}${upspeedgraph ppp0 26,80 d64937 d64937}${goto 150}${downspeedgraph ppp0 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup ppp0}${color5}${goto 150}Received: ${color2}${totaldown ppp0}
${else}
${if_existing /proc/net/route ppp1}
${voffset -240}${goto 40}${color5}Up: ${color2}${upspeed ppp1}${color5}${goto 150}Down: ${color2}${downspeed ppp1}
${voffset 10}${goto 40}${upspeedgraph ppp1 26,80 d64937 d64937}${goto 150}${downspeedgraph ppp1 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup ppp1}${color5}${goto 150}Received: ${color2}${totaldown ppp1}
${else}
${if_existing /proc/net/route wlp2s1}
${voffset -253}${goto 40}${color5}Up: ${color2}${upspeed wlp2s1}${color5}${goto 150}Down: ${color2}${downspeed wlp2s1}
${voffset 10}${goto 40}${upspeedgraph wlp2s1 26,80 d64937 d64937}${goto 150}${downspeedgraph wlp2s1 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup wlp2s1}${color5}${goto 150}Received: ${color2}${totaldown wlp2s1}
${else}
${if_existing /proc/net/route wlp2s0}
${voffset -266}${goto 40}${color5}Up: ${color2}${upspeed wlp2s0}${color5}${goto 150}Down: ${color2}${downspeed wlp2s0}
${voffset 10}${goto 40}${upspeedgraph wlp2s0 26,80 d64937 d64937}${goto 150}${downspeedgraph wlp2s0 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup wlp2s0}${color5}${goto 150}Received: ${color2}${totaldown wlp2s0}
${else}
${if_existing /proc/net/route wlan0}
${voffset -279}${goto 40}${color5}Up: ${color2}${upspeed wlan0}${color5}${goto 150}Down: ${color2}${downspeed wlan0}
${voffset 8}${goto 40}${upspeedgraph wlan0 26,80 d64937 d64937}${goto 150}${downspeedgraph wlan0 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup wlan0}${color5}${goto 150}Received: ${color2}${totaldown wlan0}
${else}
${if_existing /proc/net/route wlan1}
${voffset -292}${goto 40}${color5}Up: ${color2}${upspeed wlan1}${color5}${goto 150}Down: ${color2}${downspeed wlan1}
${voffset 10}${goto 40}${upspeedgraph wlan1 26,80 d64937 d64937}${goto 150}${downspeedgraph wlan1 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup wlan1}${color5}${goto 150}Received: ${color2}${totaldown wlan1}
${else}
${if_existing /proc/net/route eth1}
${voffset -305}${goto 40}${color5}Up: ${color2}${upspeed eth1}${color5}${goto 150}Down: ${color2}${downspeed eth1}
${voffset 10}${goto 40}${upspeedgraph eth1 26,80 d64937 d64937}${goto 150}${downspeedgraph eth1 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup eth1}${color5}${goto 150}Received: ${color2}${totaldown eth1}
${else}
${if_existing /proc/net/route eth0}
${voffset -318}${goto 40}${color5}Up: ${color2}${upspeed eth0}${color5}${goto 150}Down: ${color2}${downspeed eth0}
${voffset 10}${goto 40}${upspeedgraph eth0 26,80 d64937 d64937}${goto 150}${downspeedgraph eth0 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup eth0}${color5}${goto 150}Received: ${color2}${totaldown eth0}
${else}
${if_existing /proc/net/route enp0s0}
${voffset -331}${goto 40}${color5}Up: ${color2}${upspeed enp0s0}${color5}${goto 150}Down: ${color2}${downspeed enp0s0}
${voffset 10}${goto 40}${upspeedgraph enp0s0 26,80 d64937 d64937}${goto 150}${downspeedgraph enp0s0 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup enp0s0}${color5}${goto 150}Received: ${color2}${totaldown enp0s0}
${else}
${if_existing /proc/net/route enp0s1}
${voffset -344}${goto 40}${color5}Up: ${color2}${upspeed enp0s1}${color5}${goto 150}Down: ${color2}${downspeed enp0s1}
${voffset 10}${goto 40}${upspeedgraph enp0s1 26,80 d64937 d64937}${goto 150}${downspeedgraph enp0s1 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup enp0s1}${color5}${goto 150}Received: ${color2}${totaldown enp0s1}
${else}
${if_existing /proc/net/route enp2s0}
${voffset -344}${goto 40}${color5}Up: ${color2}${upspeed enp2s0}${color5}${goto 150}Down: ${color2}${downspeed enp2s0}
${voffset 10}${goto 40}${upspeedgraph enp0s1 26,80 d64937 d64937}${goto 150}${downspeedgraph enp0s1 26,80 d64937 d64937}
${voffset 9}${goto 40}${color5}Sent: ${color2}${totalup enp2s0}${color5}${goto 150}Received: ${color2}${totaldown enp2s0}
${else}
${voffset -311}${goto 40}${color5}Network disconnected${color}
${image ~/.harmattan-assets/misc/Numix/God-Mode/offline.png -p 44,284 -s 16x16}
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}
\
# Various images including the icons of the forecast #
\
${image ~/.harmattan-assets/misc/Numix/God-Mode/pressure.png -p 224,95 -s 16x16}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/humidity.png -p 224,115 -s 16x16}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/wind-2.png -p 224,136 -s 16x16}\
${execi 300 cp -f ~/.harmattan-assets/icons/small-#dcdcdc/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 41,207 -s 32x32}\
${execi 300 cp -f ~/.harmattan-assets/icons/small-#dcdcdc/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 119,207 -s 32x32}\
${execi 300 cp -f ~/.harmattan-assets/icons/small-#dcdcdc/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 195,207 -s 32x32}${font}${voffset -120}\

And here is the weather.xml file:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
		<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
			<channel>
		
<title>Yahoo! Weather - London, GB</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/London__GB/*http://weather.yahoo.com/forecast/UKXX0085_c.html</link>
<description>Yahoo! Weather for London, GB</description>
<language>en-us</language>
<lastBuildDate>Fri, 17 Jul 2015 6:19 pm BST</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="London" region=""   country="United Kingdom"/>
<yweather:units temperature="C" distance="km" pressure="mb" speed="km/h"/>
<yweather:wind chill="22"   direction="230"   speed="22.53" />
<yweather:atmosphere humidity="53"  visibility="9.99"  pressure="982.05"  rising="0" />
<yweather:astronomy sunrise="5:01 am"   sunset="9:08 pm"/>
<image>
<title>Yahoo! Weather</title>
<width>142</width>
<height>18</height>
<link>http://weather.yahoo.com</link>
<url>http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif</url>
</image>
<item>
<title>Conditions for London, GB at 6:19 pm BST</title>
<geo:lat>51.51</geo:lat>
<geo:long>-0.13</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/London__GB/*http://weather.yahoo.com/forecast/UKXX0085_c.html</link>
<pubDate>Fri, 17 Jul 2015 6:19 pm BST</pubDate>
<yweather:condition  text="Partly Cloudy"  code="30"  temp="22"  date="Fri, 17 Jul 2015 6:19 pm BST" />
<description><![CDATA[
<img src="http://l.yimg.com/a/i/us/we/52/30.gif"/><br />
<b>Current Conditions:</b><br />
Partly Cloudy, 22 C<BR />
<BR /><b>Forecast:</b><BR />
Fri - Partly Cloudy. High: 24 Low: 12<br />
Sat - Mostly Sunny. High: 24 Low: 13<br />
Sun - AM Showers. High: 24 Low: 15<br />
Mon - Mostly Cloudy. High: 24 Low: 17<br />
Tue - Partly Cloudy. High: 24 Low: 13<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/London__GB/*http://weather.yahoo.com/forecast/UKXX0085_c.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
]]></description>
<yweather:forecast day="Fri" date="17 Jul 2015" low="12" high="24" text="Partly Cloudy" code="29" />
<yweather:forecast day="Sat" date="18 Jul 2015" low="13" high="24" text="Mostly Sunny" code="34" />
<yweather:forecast day="Sun" date="19 Jul 2015" low="15" high="24" text="AM Showers" code="39" />
<yweather:forecast day="Mon" date="20 Jul 2015" low="17" high="24" text="Mostly Cloudy" code="28" />
<yweather:forecast day="Tue" date="21 Jul 2015" low="13" high="24" text="Partly Cloudy" code="30" />
<guid isPermaLink="false">UKXX0085_2015_07_21_7_00_BST</guid>
</item>
</channel>
</rss>

<!-- fan1637.sports.bf1.yahoo.com Fri Jul 17 10:47:08 PDT 2015 -->

Thanks and sorry for my bad english.

Offline

#2 2015-07-17 18:07:46

toz
Member
Registered: 2011-10-28
Posts: 497

Re: How to change weather in conky to my place?

In your .conkyrc file, this command:

${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=44418&u=c" -o ~/.cache/weather.xml}

...gets the weather and saves it to the xml file. It gets the weather based on two parameters:

w = woeid value
u = unit value (farenheit/celcius)

The woeid value of 44418 refers to London.

To get the correct woeid value for your location, use this lookup site. Then replace the existing woeid with your correct location woeid and optionally the unit value.

Offline

#3 2015-07-17 18:42:46

HDArtworks
Member
Registered: 2015-04-20
Posts: 60
Website

Re: How to change weather in conky to my place?

toz wrote:

In your .conkyrc file, this command:

${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=44418&u=c" -o ~/.cache/weather.xml}

...gets the weather and saves it to the xml file. It gets the weather based on two parameters:

w = woeid value
u = unit value (farenheit/celcius)

The woeid value of 44418 refers to London.

To get the correct woeid value for your location, use this lookup site. Then replace the existing woeid with your correct location woeid and optionally the unit value.

Wow.
Thanks a lot.
It works now.

Offline

Board footer

Powered by FluxBB