Welcome to the Wallpaper Generator project! This innovative tool harnesses the power of DALL-E 3 to create stunning, custom wallpapers for your macOS desktop. Whether you want images based on your own prompts, current weather conditions, or randomly generated ideas, this project has you covered.
| Bamboo Forest | Mountain Landscape |
|---|---|
![]() |
![]() |
- Generate images using DALL-E 3 based on custom or random prompts.
- Generate images based on current weather conditions for a specified city.
- Set generated images as wallpapers on macOS.
- Rotate wallpapers from a directory of generated images.
- Install, uninstall, or reinstall automatic wallpaper rotation services.
- Support for reading prompts from standard input.
- Option to rotate wallpaper immediately after generation.
- Create a virtual environment:
python3 -m venv venv
source venv/bin/activate- Install required libraries from the requirements file:
pip3 install -r requirements.txt- Create a
config.inifile in the same directory as the script with your OpenAI API key and weather preferences:
[OpenAI]
api_key = your_api_key_here
[Weather]
# Options: current or forecast
weather = forecast- Note: This project uses the DALL-E 3 model via the OpenAI API. Be aware of potential usage costs associated with generating images.
- Generate images:
python3 ./generate-wallpaper.py generate python3 ./generate-wallpaper.py generate --count 2 python3 ./generate-wallpaper.py generate --count 3 --prompt "Peaceful landscapes from around the world." python3 ./generate-wallpaper.py generate --city "New York" --rotate-now cat examples/example1 | python3 ./generate-wallpaper.py generate
- Rotate your wallpaper from existing images:
python3 ./generate-wallpaper.py rotate
To set up automatic wallpaper rotation or city-based generation, you can use the following commands:
-
Install the automatic wallpaper rotation service:
python3 ./generate-wallpaper.py install --interval 3600
-
Install the city-based wallpaper generation service:
python3 ./generate-wallpaper.py install --interval 3600 --city "London" -
Uninstall the services:
python3 ./generate-wallpaper.py uninstall
-
Reinstall the services:
python3 ./generate-wallpaper.py reinstall --interval 3600 python3 ./generate-wallpaper.py reinstall --interval 3600 --city "Paris"
These commands manage launchd services for automatic wallpaper rotation and city-based generation on macOS.
generate-wallpaper.py: Main script to generate and rotate wallpapers.weather_data.py: Module for fetching weather data and generating weather-based prompts.generate-rotate.plist.template: Template for scheduling wallpaper rotation.generate-city.plist.template: Template for scheduling city-based wallpaper generation.requirements.txt: List of required Python libraries.
openaipillowbs4requests
This project is designed for macOS. It has been tested on macOS Monterey (12.0) and later versions. Compatibility with earlier versions is not guaranteed.
TODO: Windows and Linux support.
Contributions to the Wallpaper Generator project are welcome! If you have suggestions for improvements or encounter any issues, please open an issue or submit a pull request on the project's GitHub repository.
This project is licensed under the MIT License.

