A Python application that automatically changes your desktop wallpaper based on current weather conditions. The app downloads beautiful nature landscape images from Unsplash that match the current weather and overlays weather information on them.
- 🌤️ Real-time Weather Integration: Uses WeatherAPI.com to get current weather data
- 🖼️ Dynamic Image Downloads: Fetches relevant landscape images from Unsplash
- 📍 Weather Overlay: Displays temperature, condition, and location on wallpapers
- 🔄 Automatic Updates: Changes wallpaper every 10 minutes when weather changes
- 🧹 Smart Cleanup: Automatically removes old images to save disk space
- ⚡ Multi-threaded: Efficient background operation with graceful shutdown
- Python 3.7 or higher
- Windows OS (wallpaper changing functionality)
- Internet connection for weather and image APIs
-
Clone the repository:
git clone https://github.com/yourusername/dynamic-weather-wallpaper.git cd dynamic-weather-wallpaper -
Create a virtual environment:
python -m venv venv venv\Scripts\activate # On Windows
-
Install dependencies:
# Option 1: Use the setup script (recommended) python setup.py # Option 2: Manual installation pip install -r requirements.txt
-
Set up API keys:
- Get a free API key from WeatherAPI.com
- Get a free API key from Unsplash
- Copy
env.exampleto.envand fill in your API keys:
copy env.example .env
- Edit
.envfile with your actual API keys and preferences
-
Configure your settings in the
.envfile (see Installation step 4) -
Run the application:
python main.py
-
The app will:
- Check current weather every 10 minutes
- Download relevant landscape images
- Add weather overlay to images
- Change your desktop wallpaper automatically
-
To stop the application: Press
Ctrl+Cfor graceful shutdown
You can customize the application by modifying these settings in main.py:
- Update frequency: Change the
delayparameter (default: 600 seconds) - Overlay position: Use
set_position()method ('top-right', 'top-left', 'bottom-right', 'bottom-left') - Font size: Use
set_font_size()method - Colors: Use
set_colors()method for text and shadow colors
dynamic-weather-wallpaper/
├── main.py # Main application entry point
├── weather_check.py # Weather API integration
├── image_downloader.py # Unsplash image downloading
├── weather_overlay.py # Weather information overlay
├── changeWallpaper.py # Desktop wallpaper management
├── config.py # Configuration management
├── requirements.txt # Python dependencies
├── setup.py # Setup script
├── README.md # This file
├── LICENSE # MIT License
├── .gitignore # Git ignore rules
├── env.example # Environment variables template
├── .env # API keys and configuration (create from env.example)
└── images/ # Downloaded wallpaper images
- Free tier: 1,000,000 calls per month
- Rate limit: 1 call per second
- Sign up: WeatherAPI.com
- Free tier: 5,000 requests per hour
- Rate limit: 50 requests per hour
- Sign up: Unsplash Developers
-
"API key not found" error:
- Ensure your
.envfile exists and contains valid API keys - Check that API keys are complete (not truncated)
- Ensure your
-
"Failed to change wallpaper" error:
- Ensure you're running on Windows
- Check that image files exist and are accessible
- Run as administrator if needed
-
"Weather API request failed" error:
- Check your internet connection
- Verify your WeatherAPI key is valid
- Ensure the city name is correct
-
"Failed to get image from Unsplash" error:
- Check your internet connection
- Verify your Unsplash access key is valid
- Check if you've exceeded rate limits
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- WeatherAPI.com for weather data
- Unsplash for beautiful landscape images
- Pillow for image processing