This Python script changes your desktop wallpaper based on the weather.
$ git clone https://github.com/yangman946/WallPaperChanger
You need:
- install requirements:
pip install -r requirements.txt
- Image url for weather widget: customise your own widget here: https://www.theweather.com/
- Your own api key for openweather: https://openweathermap.org/api
refer to mainScript.py
for where to insert these values.
You can run this script two ways:
- Via the
run.bat
script - Change the first line CD {your file location} to the file location of
run.bat
- and use Windows Task scheduler to periodically run the
run.bat
file. You could make the script run once every hour. - Or import the provided .xml file into task scheduler (change path to your batch file)
- or Via the command line
- CD to your directory
- run
python -m wallpaperChanger.mainScript
Currently, the mainScript.py
script supports the following weather states:
- Clear
- Mist (cloudy)
- Rain
- and thunder
You will find separate pairs of folders for each weather condition (day and night). These folders contain jpeg images (3936x2624 pixels) each labeled from 1 to the number of images in the folder. If you wish to replace images, ensure that:
- The images are of correct size (recommended 3936x2624 pixels)
- The images are in the correct folders
- The images are properly labelled {weather state}_{day state}_{image index}
- The images are jpeg images
To customise the layout of the wallpaper, refer to the configurations
dictionary at mainScript.py
.
Here, you can add custom layouts or use existing ones. Each layout requires six parameters:
- Coordinates of your widget (x, y)
- Day/date text location ("x", "y")
- "x": left, center or right
- "y": top, center or bottom
- show water mark (true, false)
- show compile time (true, false)
- Compile time location ("x", "y")
- "x": left, center or right
- "y": top, center or bottom
- Font
- Bold
- ExtraBold
- ExtraLight
- Italic
- Light
- Medium
- Regular
- Thin
- See all fonts
If you wish to contribute to this project, send a pull request, and I will look at it. Here’s an easy and quick video guide for learning how to contribute via GitHub.
This project is a work in progress and will expect frequent updates.
- Expand wallpaper folders.
Add a sunrise/sunset API to change the daystate.- Add temperature conditions and assign certain wallpapers to temperature.
Make the program run without appearing (invisible)
- Find a wallpaper API, reduces need for having folders full of images
- Show news or other information along with the weather.
- Export as an executable
Make this project compatible with non-windows systems.