Desktop background wallpaper, based on current weather and time
A python script that changes your computer's desktop background based on current weather and time of the day. The weather is obtained from https://openweathermap.org/ API.
Steps
- Register to
https://openweathermap.org/for free and generate your free API key. The default one should look something like:93aa1ae52d8df6151ee049fid863a3q0. Then copy paste your API key to theapi_keyvariable. - Save the photos you want for each weather and time of the day in any folder you want (just make sure to remember absolute path to your map and save it to
path_to_photosvariable). Make sure that photos have names:thunderstorm.jpgif the weather is thunderstorms,rain.jpgfor rainy weather,snow.jpgif it snows,fog.jpgfor foggy weather,clear.jpgfor clear sky,clear_night.jpgfor clear sky at night andclouds.jpgfor cloudy weather. - Convert
main.pyfile tomain.exefile and put it in your StartUp folder that the program will run everytime you start your computer:- converting from
.pyto.exeusingauto-py-to-exetool - automatic run on computer start up
- if you want your wallpaper to update every some time (for example every half hour), you can do that with Task scheduler.
- converting from
- Done
Results
Background image based on weather and time of the day:
| weather, time | day | night |
|---|---|---|
| clear | clear.jpg |
clear_night.jpg |
| cloudy | clouds.jpg |
clouds.jpg |
| rainy | rain.jpg |
rain.jpg |
| thunderstorm | thunderstorm.jpg |
thunderstorm.jpg |
| snowy | snow.jpg |
snow.jpg |
| foggy | fog.jpg |
fog.jpg |