You are not logged in.

#201 2025-12-13 20:28:40

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

Conky TAD script  -  latest version

You will always have the updated version here *

Instructions for beginners and those who have not used the TAD script before:

1) You can download the script here:
https://workupload.com/file/sTwCCMR6UQH

2) Open ~/Downloads folder  >  Right click on time_and_date_conky_script.tar.xz   >  Extract Here

3) Copy/paste the resulting folder into HOME

4) Open the folder and you will get this:
fm.png

5) Open the  tad  script (image above) with a text editor and don't forget to change the location (instead of Paris, France):
text-editor.png

Done.

Open a terminal and run the script once:

bash ~/time_and_date_conky_script/tad

You will get a complete weather forecast for your location (Now, Daily, Hourly).
This is what it should look like:
daily.png  hourly.png

---

Those who already use the TAD script will have an updated version here:

#!/bin/bash

## Time and Date is the world's leading time and time zone website.

## Be sure to visit it because it has very useful things for each location and all the data is displayed in real time.
## Weather forecast is just a small part of what this great website offers.


# Go to https://www.timeanddate.com/weather
# Find your address in the search field.

#Copy the address from the Firefox URL bar and paste it in the same form here instead of Paris, France.

address="https://www.timeanddate.com/weather/france/paris"

curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -s "$address" > $HOME/time_and_date_conky_script/weather_raw


#### NOW FORECAST

## Temperature
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2>[^<]*' | sed 's/^/Temperature:/' | sed 's/class=h2>//' | sed 's/&nbsp;/ /' > $HOME/time_and_date_conky_script/now

## Feels Like
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[F^]eels Like:[^<]*' | sed 's/&nbsp;/ /' >> $HOME/time_and_date_conky_script/now

## Forecast
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]title="High and low forecasted temperature today">Forecast: [^&nbsp;]*' | awk -F'>' '{print $2}' >> $HOME/time_and_date_conky_script/now

## Text Now
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]id=cur-weather class=mtt title="[^"]*' | sed 's/ id=cur-weather class=mtt title="//' >> $HOME/time_and_date_conky_script/now

## Visibility
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[V^]isibility: [^P]*' | sed 's/<\/th><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/time_and_date_conky_script/now

## Pressure
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[P^]ressure: [^H]*' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/time_and_date_conky_script/now

## Humidity
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[H^]umidity:[^D]*' | sed '$d' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' >> $HOME/time_and_date_conky_script/now

## Dew Point
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[D^]ew Point: [^ ]*' | sed 's/<\/th><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><\/tbody><\/table><\/div><div//' >> $HOME/time_and_date_conky_script/now

## Wind
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[W^]ind: [^<]*' | sed '$d' >> $HOME/time_and_date_conky_script/now

## Wind Direction
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[>^] from[^<]*' | sed '$d' | sed 's/> //' >> $HOME/time_and_date_conky_script/now

## Latest Report
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[L^]atest Report: [^V]*' | sed 's/<\/th><td>//' | sed 's/<\/td><\/tr><tr><th>//' | sed 's/年/\//' | sed 's/月/\//' | sed 's/日 (金)/ /' | sed 's/時/:/' | sed 's/分//' >> $HOME/time_and_date_conky_script/now


## Now Image
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed '1q;d' | sed 's/ src="/https:/' | sed 's/.$//' > $HOME/time_and_date_conky_script/images

day_0=$(sed -n '1p' $HOME/time_and_date_conky_script/images | awk -F'svg/' '{print $2}' | sed 's/svg/png/')

cp $HOME/time_and_date_conky_script/tad-icons/$day_0 $HOME/time_and_date_conky_script/0.png

> $HOME/time_and_date_conky_script/images

## Wind Direction Image
wd=$(sed -n '10p' $HOME/time_and_date_conky_script/now | sed 's/from //' | sed 's/North/N/g' | sed 's/north/N/g' |  sed 's/South/S/g' | sed 's/south/S/g' |  sed 's/East/E/g' | sed 's/east/E/g' | sed 's/West/W/g' | sed 's/west/W/g' | sed 's/-//' | sed 's/$/.png/')

## Wind Rose
                       ## 04/12/25                         
  if [[ "$wd" == ".png" ]] || [[ "$wd" == "Wind: N/A .png" ]]; then
  
      cp $HOME/time_and_date_conky_script/wind/CLM.png $HOME/time_and_date_conky_script/wind_0.png

        else
    
           cp $HOME/time_and_date_conky_script/wind/$wd $HOME/time_and_date_conky_script/wind_0.png
      
  fi


#### DAILY FORECAST

## Temperatures (Next 7 days) 
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[^ ]*width=60 height=60><p>[^&nbsp;]*' | sed 's/width=60 height=60><p>//' | sed 7q > $HOME/time_and_date_conky_script/temperatures

## Images (Next 7 Days)
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | sed -n '19,25p' | sed 's/ src="/https:/' | sed 's/.$//' | awk -F'svg/' '{print $2}' | sed 's/svg/png/' > $HOME/time_and_date_conky_script/images

## Icons (Next 7 Days)
  j=1
                       
    for (( i=1; i<=7; i+=1 ))
			
      do
		    	
        cp $HOME/time_and_date_conky_script/tad-icons/$(sed -n ${i}p $HOME/time_and_date_conky_script/images) $HOME/time_and_date_conky_script/day_$j.png
    
  ((j++))
  
  done
  
## Phrase (Next 7 Days)
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=mtt title="[^"]*' | sed -n '18,24p' | sed 's/ class=mtt title="//' > $HOME/time_and_date_conky_script/phrase   
  

#### HOURLY FORECAST

## Temperature
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class="h2 soft" [^ ]*' | sed -e 's/<\/td><td>/\n/g' | sed '1,1d' | sed 's/ class="h2 soft" ><td>//' | sed 's/&nbsp;/ /' | sed 's/<\/td><\/tr><\/tbody><\/table><\/div><p//' > $HOME/time_and_date_conky_script/hourly/temperature

## Time
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]class=h2 ><td>Now</td><td>[^r]*' | sed -e 's/<\/td><td>/\n/g' | sed '1,1d' | sed 's/<\/td><\/t//' > $HOME/time_and_date_conky_script/hourly/time


## Images
cat $HOME/time_and_date_conky_script/weather_raw | grep -o '[ ^]src="//c.tadst.com/gfx/w/svg[^ ]*' | awk -F'svg/' '{print $2}' | sed -n '3,7p' | sed 's/.$//' | sed 's/svg/png/' > $HOME/time_and_date_conky_script/hourly/images

## Icons
  j=1
                       
    for (( i=1; i<=5; i+=1 ))
			
      do
		    	
        cp $HOME/time_and_date_conky_script/tad-icons/$(sed -n ${i}p $HOME/time_and_date_conky_script/hourly/images) $HOME/time_and_date_conky_script/hourly/hourly_$j.png
    
  ((j++))
  
  done
  

#### DAY + DATE (Next 7 Days) 
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -s "$address/ext" > $HOME/time_and_date_conky_script/date-raw

cat $HOME/time_and_date_conky_script/date-raw | grep -o '[,^]"ds":"[^"]*' | sed 's/,"ds":"//g' | sed 's/\.//g' | sed -n '1,7p' > $HOME/time_and_date_conky_script/date

If people would know how little brain is ruling the world, they would die of fear.

Offline

#202 2025-12-14 13:44:20

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

How to Replace Icons?

Thanks to @asqwerth who customized the Weather Underground icons it's easy to replace the original icons.

Open the  tad  script with a text editor and replace tad-icons  with tad-icons-WU  (in three places).
The fastest way is to use Find and Replace:
gedit.png

If you want to use your favorite weather icons, add a folder with those icons, but the names must be the same as the original ones (wt-XX.png).


If people would know how little brain is ruling the world, they would die of fear.

Offline

#203 2025-12-14 20:28:34

ceeslans
Member
Registered: 2015-09-30
Posts: 201

Re: Conky Weather TAD script

thanks @marens for sharing your wonderful tad script, works like a charm.
and thanks @asqwerth for sharing your conky config file (#169) and WU icons.

cheeese-20251214-204908.png

Last edited by ceeslans (2025-12-14 20:29:03)

Offline

#204 Yesterday 13:41:55

loutch
Member
Registered: 2015-12-12
Posts: 967

Re: Conky Weather TAD script

Hello

Hello version from  @asqwerth  with lua background & drawImage


v4WVDaJI_t.png

with clear wallpaper

Dn3nNMeS_t.png

@+


Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX

Offline

#205 Yesterday 14:50:20

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

^ If you want capital letters in the Day/Date, just change the lines in conky:

$ echo 'lun 15 dec' | sed -r 's/\<./\U&/g'
Lun 15 Dec

$ sed -n '1p' $HOME/time_and_date_conky_script/date | sed -r 's/\<./\U&/g'
Lun 15 Dec

Have you checked the date_and_phrase file?
It will be unusable until tonight.

Now you can remove it, as well as the entire section within the TAD script.


If people would know how little brain is ruling the world, they would die of fear.

Offline

#206 Yesterday 15:50:20

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 1,035

Re: Conky Weather TAD script

ceeslans wrote:

thanks @marens for sharing your wonderful tad script, works like a charm.
and thanks @asqwerth for sharing your conky config file (#169) and WU icons.

https://i.postimg.cc/Y4mm27Qr/cheeese-20251214-204908.png

I know you are conkyweatherfont user:
https://forums.bunsenlabs.org/viewtopic … 70#p132570

You can easily replace acc_RSS conky.
I made a TAD script to help those who don't have your knowledge and experience.

Enjoy.  smile

Edit
Link added.

Last edited by marens (Yesterday 23:26:20)


If people would know how little brain is ruling the world, they would die of fear.

Offline

Board footer

Powered by FluxBB