https://forum.mxlinux.org/viewtopic.php ... 26#p417226
This is the one I've been using since MX14, when it was using yahooweather. After that free service died, I had to switch the scripts to openweathermap ones, adapted from zagortenay (deviantart).
First, make sure you have jq and curl installed on your system.
Here is the conky text (I'm giving you the old syntax version so it will show up in Conky manager):
Code: Select all
# Conky Google Now style #
# Conky settings #
background no
update_interval 1
double_buffer yes
no_buffers yes
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual yes
#own_window_argb_value 255
#own_window_colour 2D2D2D
minimum_size 150
# Alignment #
alignment br
gap_x 70
gap_y 40
border_inner_margin 15
border_outer_margin 0
# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# Text settings #
use_xft yes
xftalpha 0
xftfont Open Sans Light:size=10
override_utf8_locale yes
imlib_cache_size 0
# Color scheme #
default_color ffffff
color1 FFFFFF
color2 9933CC
color3 669900
color4 FF8800
color5 CC0000
color6 AAAAAA
TEXT
${execi 300 l=en; l=${l%%_*}; curl -s "api.openweathermap.org/data/2.5/forecast/daily?APPID=[INSERT YOUR OPENWEATHER API HERE]&id=[INSERT OPENWEATHER CITY ID CODE HERE]&cnt=5&units=metric&lang=$l" -o ~/.cache/forecast.json}\
${execi 300 l=en; l=${l%%_*}; curl -s "api.openweathermap.org/data/2.5/weather?APPID=[INSERT YOUR OPENWEATHER API HERE]&id=[INSERT OPENWEATHER CITY ID CODE HERE]&cnt=5&units=metric&lang=$l" -o ~/.cache/weather.json}\
${font Open Sans Light:size=16}${color0}${execi 300 jq -r .city.name ~/.cache/forecast.json}, ${execi 300 jq -r .city.country ~/.cache/forecast.json}${font}\
${font Open Sans Light:size=90}${goto 246}${execi 300 jq -r .main.temp ~/.cache/weather.json | awk '{print int($1+0.5)}' # round num}°${font}${color}${voffset -28}${goto 10}\
${execi 300 cp -f ~/.conky-google-now-Openweather/$(jq .weather[0].id ~/.cache/weather.json).png ~/.cache/weather.png}${image $HOME/.cache/weather.png -p 0,36 -s 60x60}${color0}${execi 300 jq -r .weather[0].description ~/.cache/weather.json | sed "s|\<.|\U&|g"}
${image $HOME/.conky-google-now-Openweather/wind.png -p 0,115 -s 15x15}${goto 35}${execi 300 jq -r .wind.speed ~/.cache/weather.json | awk '{print int($1+0.5)}' # round num} m/s
${image $HOME/.conky-google-now-Openweather/humidity.png -p 0,132 -s 15x15}${goto 35}${color0}${execi 300 jq -r .main.humidity ~/.cache/weather.json | awk '{print int($1+0.5)}' # round num}%
${execi 300 cp -f ~/.conky-google-now-Openweather/$(jq .weather[0].id ~/.cache/weather.json).png ~/.cache/current.png}${image ~/.cache/current.png -p 11,203 -s 32x32}\
${execi 300 cp -f ~/.conky-google-now-Openweather/$(jq .list[1].weather[0].id ~/.cache/forecast.json).png ~/.cache/forecast-1.png}${image ~/.cache/forecast-1.png -p 109,203 -s 32x32}\
${execi 300 cp -f ~/.conky-google-now-Openweather/$(jq .list[2].weather[0].id ~/.cache/forecast.json).png ~/.cache/forecast-2.png}${image ~/.cache/forecast-2.png -p 193,203 -s 32x32}\
${execi 300 cp -f ~/.conky-google-now-Openweather/$(jq .list[3].weather[0].id ~/.cache/forecast.json).png ~/.cache/forecast-3.png}${image ~/.cache/forecast-3.png -p 286,203 -s 32x32}\
${execi 300 cp -f ~/.conky-google-now-Openweather/$(jq .list[4].weather[0].id ~/.cache/forecast.json).png ~/.cache/forecast-4.png}${image ~/.cache/forecast-4.png -p 374,203 -s 32x32}\
\
${voffset 30}\
${font Open Sans Light:size=12}${color0}\
${goto 30}${execi 300 LANG=en LC_TIME=en date +%^a}\
${goto 120}${execi 300 LANG=en LC_TIME=en date -d +1day +%^a}\
${goto 210}${execi 300 LANG=en LC_TIME=en date -d +2days +%^a}\
${goto 300}${execi 300 LANG=en LC_TIME=en date -d +3days +%^a}\
${goto 390}${execi 300 LANG=en LC_TIME=en date -d +4days +%^a}\
\
${voffset 57}\
${goto 32}${execi 300 jq .list[0].temp.max ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
${goto 122}${execi 300 jq .list[1].temp.max ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
${goto 212}${execi 300 jq .list[2].temp.max ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
${goto 302}${execi 300 jq .list[3].temp.max ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
${goto 392}${execi 300 jq .list[4].temp.max ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
\
${voffset 25}\
${goto 32}${execi 300 jq .list[0].temp.min ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
${goto 122}${execi 300 jq .list[1].temp.min ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
${goto 212}${execi 300 jq .list[2].temp.min ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
${goto 302}${execi 300 jq .list[3].temp.min ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
${goto 392}${execi 300 jq .list[4].temp.min ~/.cache/forecast.json | awk '{print int($1+0.5)}' # round num}°\
${hr}
#${color #ffffff}${font GeosansLight:pixelsize=25}The time is ${time %H:%M:%S}
#${color #ffffff}${font GeosansLight:pixelsize=25}${time %A, %d %B, %Y}
${font GeosansLight:pixelsize=14}Host:$alignr$nodename
OS:$alignr${execi 1000 cat /etc/mx-version}
Uptime:$alignr$uptime
RAM:$alignr$mem/$memmax
Swap usage:$alignr$swap/$swapmax
Root usage:$alignr${fs_used /}/${fs_size /}
Home usage:$alignr${fs_used /home/tuaz}/${fs_size /home/tuaz}
CPU usage:$alignr${cpu cpu0}%
Kernel:$alignr${kernel}
a) you will need to go to openweathermap.org and sign up for your own API key (free but you have to register) and then fill it in here;
https://www.openweathermap.org/api
I got the 5-day one.
b) CIty ID code: find it here http://openweathermap.org/help/city_list.txt and fill enter it into the 2 said lines as indicated.
After that:
c) modify the bottom half of conky as you deem fit
d) I attach an archive file of weather icons, to be saved as ~/.conky-google-now-Openweather/
(NB.The icons came from the Conky Manager theme pack that could be downloaded from TeeJee's site, I believe..
But I had to renumber the icons to fit openweathermap's format for weather info (I copied zagortenay's system that he used for his own weather icons).)
When you first run the conky, the weather icons and forecasts may not show up immediately. The curl thingy needs to do its thing to grab the information from openweathermap and populate your ~/.cache folder.
I find what works is to let the conky run without the weather icons for a while, then kill the conky with "killall conky". Maybe run another conky. Then come back to this one and this time the icons will be picked up.