Skip to content

noodkhan/RandomPCBackground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🌆 Random PC Background Fetcher (Python)

Introduction

This Python project allows you to fetch random images from Unsplash and set them as your computer's desktop background. The script connects to the Unsplash API, downloads a random image, and then sets it as your PC's wallpaper. This project is built to be easy to use and customizable, letting you refresh your background daily with beautiful, high-quality images.

Roadmap

🚀 Phase 1: Project Setup and Dependencies

  • Goal: Set up the project structure and install necessary dependencies.
  • Tasks:
    • Create a new Python project and set up a virtual environment (python -m venv venv).
    • Install necessary libraries:
      • requests for making HTTP requests to the Unsplash API.
      • os and platform to handle background setting on different OS platforms.
      • Pillow (optional) for image manipulation and resizing.
    • Set up the project folder structure (e.g., src/, downloads/).
    • Create a requirements.txt for easy dependency management.

🔧 Phase 2: Connect to Unsplash API

  • Goal: Fetch a random image from Unsplash.
  • Tasks:
    • Register for an API key on Unsplash: Unsplash Developer.
    • Write a Python script to make requests to the Unsplash API using the requests library.
    • Fetch a random image URL by calling the Unsplash random photo endpoint.
    • Extract image metadata (e.g., photo URL, author, etc.).

🖼️ Phase 3: Download the Image

  • Goal: Download the random image to your local machine.
  • Tasks:
    • Parse the image URL returned by the Unsplash API.
    • Use Python’s requests module to download the image.
    • Save the image in a folder on your computer (e.g., downloads/).
    • Handle errors such as broken links or failed downloads.

⚙️ Phase 4: Set Image as Desktop Background

  • Goal: Automatically set the downloaded image as the desktop wallpaper.
  • Tasks:
    • Use Python’s os and platform libraries to detect the operating system (Windows, macOS, Linux).
    • Use platform-specific commands to change the desktop wallpaper:
      • On Windows, use the ctypes library to interact with the system's registry.
      • On macOS, use osascript (AppleScript) to set the desktop wallpaper.
      • On Linux, use feh or gsettings to set the background.
    • Implement a method that will apply the downloaded image as the wallpaper.

🧰 Phase 5: Scheduling and Automation

  • Goal: Automatically change the wallpaper at a scheduled time (e.g., daily).
  • Tasks:
    • Use a task scheduler to automate the script:
      • On Windows, use Task Scheduler to run the script daily.
      • On macOS/Linux, use cron to schedule the task.
    • Allow the user to configure the interval for changing the background (e.g., every hour, day, or week).

📝 Phase 6: Error Handling and Logging

  • Goal: Ensure the application handles errors gracefully and logs key activities.
  • Tasks:
    • Implement error handling for scenarios such as no internet connection, failed image download, or invalid API responses.
    • Log important activities (e.g., successful background changes, errors) using Python's logging library.
    • Provide user-friendly error messages and handle edge cases effectively.

🖥️ Phase 7: Testing and Validation

  • Goal: Test the application to ensure it works as expected across different platforms and edge cases.
  • Tasks:
    • Test the background change functionality on Windows, macOS, and Linux.
    • Test for different image sizes and handle potential issues with image dimensions.
    • Validate the scheduling feature works correctly with different intervals and platforms.

📚 Phase 8: Documentation and Deployment

  • Goal: Document the project and provide clear setup instructions.
  • Tasks:
    • Write a detailed README with setup instructions, usage examples, and prerequisites (e.g., Unsplash API key).
    • Include instructions for installing dependencies, running the script, and setting up automation.
    • Optionally, package the script into an executable using tools like PyInstaller for easy deployment.

🎯 Stretch Goals

  • GUI Interface: Create a simple GUI for users who prefer not to use the command line.
  • Custom Themes: Allow users to choose categories or specific themes (e.g., nature, cityscape) for random backgrounds.
  • Background Rotation: Implement functionality to cycle through multiple images in a folder or playlist.
  • More Platforms: Support additional platforms like mobile devices or smart TVs for a cross-platform experience.

This roadmap outlines the key phases to build a Random PC Background Fetcher with Python. It covers fetching random images from Unsplash, downloading them, and setting them as desktop backgrounds, as well as future enhancements like automation, error handling, and a GUI.

Screenshot 2024-09-21 073846

About

Random Background For PC API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages