WallPaperChanger is a Python script that changes your desktop wallpaper according to your current time and weather.
- Images API - new and unique wallpaper every time
- Weather API - changes wallpaper depending on weather (rain/mist/clear/thunder) and time (sunrise/day/sunset/night)
- Weather widget - Shows weather forecast
- Displayed time and date + refreshable clock
$ git clone https://github.com/yangman946/WallPaperChanger
You need:
- to install requirements:
pip install -r requirements.txt
- Your own api key from openweather: https://openweathermap.org/api
- (Optional) Image url for a weather widget: customise your own widget here: https://www.theweather.com/
Alternatively you can choose to run WallPaperChanger offline with a selection of default wallpapers.
Refer to settings.py
for where to insert these values.
You can run this script in two ways:
You can either run the script manually or via a task scheduler to run it periodically (i.e., every hour).
Make sure to edit the run.bat
script to add the directory for which the batch script is located.
A premade windows task scheduler xml file is provided in the project root.
You may also decide to run the refresh.bat
script every minute to update the live clock.
-
Open the project in your terminal of choice (or use
cd
to move to the project root) -
Run the app using the following command.
python -m wallpaperChanger
Various batch files have been included with this project:
run.bat
- changes the wallpaper, can be run from a task schedulerrefresh.bat
- only changes the clock at the bottom right of the wallpaperdislike.bat
- can add the wallpaper toblacklisted_wallpapers.txt
, effectively removing it from ever being seen
You can create desktop shortcuts to these batch files for quick and easy access.
You will find separate folders for each weather condition (day/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 review it ASAP. Here’s an easy and quick video guide for learning how to contribute via GitHub.