A Python application that allows you to update your desktop wallpaper dynamically based on a screenshot of a webpage. The wallpaper is updated when a keyboard event is triggered, and the application enforces a cooldown period between updates. This project is ideal for creating a dynamic and customizable desktop experience.
- Captures a screenshot of a specified webpage using Puppeteer.
- Updates the desktop wallpaper with the captured screenshot.
- Enforces a cooldown period between updates to prevent excessive changes.
- Runs in the background and listens for keyboard events to trigger updates.
- Easy to host as a persistent background service using PM2.
- Python 3.7+
- Node.js (for PM2 hosting, optional but recommended)
- Python libraries:
playwright
asyncio
ctypes
(standard library)datetime
(standard library)
-
Clone the repository:
git clone https://github.com/asdat3/winwallpaper_from_scraper.git cd winwallpaper_from_scraper
-
Install the required Python packages:
pip install -r requirements.txt
-
Ensure Node.js and PM2 are installed (optional but recommended for background hosting):
npm install -g pm2
-
Install playwright (it will prompt you once you run the script)
-
Start the Python script:
python main.py
-
Press any key to trigger the wallpaper update process.
Hosting the application using PM2 allows it to run seamlessly in the background and even start automatically on system boot.
-
Start the application with PM2:
pm2 start main.py --interpreter python3 --name "WallpaperManager"
-
Save the PM2 process list to start on system boot:
pm2 save pm2 startup
-
Check the application status:
pm2 status
-
Stop the application:
pm2 stop WallpaperManager
- Capture Screenshot: The application uses Puppeteer to navigate to a webpage and capture a screenshot.
- Set Wallpaper: The screenshot is saved locally and set as the desktop wallpaper using the
ctypes
library. - Keyboard Event Listener: The
keyboard
library listens for keypress events, which trigger the screenshot and wallpaper update process. - Cooldown Enforcement: A cooldown period prevents frequent updates, ensuring smooth operation.
- Add support for customizable hotkeys.
- Allow users to specify the webpage URL dynamically.
- Implement better error handling for system-specific wallpaper settings.
- Add an interactive GUI for non-technical users.
This tool is intended for personal use only. Ensure compliance with the terms of service of any website accessed using this tool.