Gis Weather not loading for some reason, looking for substitute

Report Bugs, Issues and non- package Requests
Message
Author
User avatar
asqwerth
Developer
Posts: 7212
Joined: Sun May 27, 2007 5:37 am

Re: Gis Weather not loading for some reason, looking for substitute

#51 Post by asqwerth »

Sure, since I'm waiting for the next match....

Image
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}
1st 2 lines after "TEXT" (Lines 57-58):
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.
You do not have the required permissions to view the files attached to this post.
Last edited by asqwerth on Tue Jul 10, 2018 11:02 pm, edited 1 time in total.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
Eadwine Rose
Administrator
Posts: 11895
Joined: Wed Jul 12, 2006 2:10 am

Re: Gis Weather not loading for some reason, looking for substitute

#52 Post by Eadwine Rose »

Thanks! I'll take a looksee tomorrow, but thanks for sharing!
MX-23.2_x64 July 31 2023 * 6.1.0-18-amd64 ext4 Xfce 4.18.1 * 8core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 525.147.05 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 860EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
rokytnji.1
Global Moderator
Posts: 706
Joined: Sun Apr 13, 2014 9:06 pm

Re: Gis Weather not loading for some reason, looking for substitute

#53 Post by rokytnji.1 »

male wrote: Thu Jun 21, 2018 11:32 am
rokytnji.1 wrote:If wttr could find me. I'd use this in my conkyrc.

Code: Select all

curl 'wttr.in/Pecos?q?0?T'
Pecos, United States of America

     \   /     Sunny
      .-.      28-30 °C       
   ― (   ) ―   ← 17 km/h      
      `-’      16 km          
     /   \     0.0 mm

viewtopic.php?f=108&t=44927&start=20#p446155 ;)
Thanks a bunch male.

Image

User avatar
asqwerth
Developer
Posts: 7212
Joined: Sun May 27, 2007 5:37 am

Re: Gis Weather not loading for some reason, looking for substitute

#54 Post by asqwerth »

Cool, rokytnki.1 (and male, of course)!

I'm not home right now, but here was my previous modification of the semplice conky (a slightly diff version is in MX17, called MX-GeekyTowerLogo) to add the Accuweather RSS script at the bottom: viewtopic.php?p=408289#p408289
asqwerth wrote: Sun Feb 26, 2017 5:58 am ...

The weather and conky scripts plus tips to get this going came from Bunsenlabs forum, from the most hardcore creator of weather conkys I've ever seen, TeoBigusGeekus (I adapted script #1(d)). Link to post below. The downloadable zip file contains a pdf file with detailed instructions.

https://forums.bunsenlabs.org/viewtopic ... 1545#p1545

If you can't get the location code from the new layout of Accuweather's site, try this list. http://pastebin.com/dbtemx5F
My location's code is still valid but I can't vouch for other places.


Image

Note: there was some reorganisation of the bunsenlabs original post, but script #1(d) in the old conky syntax can be found here:
https://forums.bunsenlabs.org/viewtopic ... 2307#p2307
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
Richard
Posts: 1577
Joined: Fri Dec 12, 2008 10:31 am

Re: Gis Weather not loading for some reason, looking for substitute

#55 Post by Richard »

@Eadwine Rose,
you mentioned, "First, make sure you have jq and curl installed on your system."

I have curl but can't find jq.
Where might it be found?
By another name?

Thanks.
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.

User avatar
asqwerth
Developer
Posts: 7212
Joined: Sun May 27, 2007 5:37 am

Re: Gis Weather not loading for some reason, looking for substitute

#56 Post by asqwerth »

Richard wrote: Fri Jun 22, 2018 2:13 pm @Eadwine Rose,
you mentioned, "First, make sure you have jq and curl installed on your system."

I have curl but can't find jq.
Where might it be found?
By another name?

Thanks.
Are you running MX17? It's there.
ksnip_20180623$.png
You do not have the required permissions to view the files attached to this post.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
Stevo
Developer
Posts: 12774
Joined: Fri Dec 15, 2006 8:07 pm

Re: Gis Weather not loading for some reason, looking for substitute

#57 Post by Stevo »

asqwerth wrote: Fri Jun 22, 2018 2:34 pm
Richard wrote: Fri Jun 22, 2018 2:13 pm @Eadwine Rose,
you mentioned, "First, make sure you have jq and curl installed on your system."

I have curl but can't find jq.
Where might it be found?
By another name?

Thanks.
Are you running MX17? It's there.

ksnip_20180623$.png
In another thread, "inxi -r" just showed that Richard doesn't have the main Debian repo in his sources...

User avatar
Richard
Posts: 1577
Joined: Fri Dec 12, 2008 10:31 am

Re: Gis Weather not loading for some reason, looking for substitute

#58 Post by Richard »

I haven't consciously removed the debian repo, but obviously that is why things are missing.
Well that is good to know.
I'll have to go looking for it.
Thanks, Stevo.

Code: Select all

$ inxi -r
Repos:     Active apt repos in: /etc/apt/sources.list.d/antix.list 
           1: deb https://ftp.nluug.nl/os/Linux/distr/mxlinux/antix/stretch/ stretch main
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://ftp.br.debian.org/debian/ stretch-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://security.debian.org/ stretch/updates non-free contrib main
           Active apt repos in: /etc/apt/sources.list.d/doublecmd.list 
           1: deb http://download.opensuse.org/repositories/home:/Alexx2000:/doublecmd-svn/Debian_8.0/ /
           No active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb https://ftp.nluug.nl/os/Linux/distr/mxlinux/mx/repo/ stretch non-free main
           No active apt repos in: /etc/apt/sources.list.d/skype-stable.list 
           No active apt repos in: /etc/apt/sources.list.d/various.list 
           No active apt repos in: /etc/apt/sources.list.d/vivaldi.list 
richard@T430:~
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.

male

Re: Gis Weather not loading for some reason, looking for substitute

#59 Post by male »

rokytnji.1 wrote:
Thanks a bunch male.
:number1:
You're welcome.

male

Re: Gis Weather not loading for some reason, looking for substitute

#60 Post by male »

Hi Eadwine

because of your contribution here I would like to "give" you a Conky. Even if you wrote that you don't necessarily want to tinker with a Conky.

I have played a little with the location The Hague and tried to do justice to it in your preference in the disign of GIS weather. ;)
letzter.jpg

Would you like that and do you currently have time (this week)? I set the configuration in "Conky help and stuff" and give you instructions?
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “Bugs and Non-Package Requests Forum”