top of page

import os import subprocess import schedule import time def set_screensaver(): # Step 1: Run try: result =["python3", "/path/to/"]) # Step 2: Identify the path of the generated image desktop_path = os.path.expanduser("~/Desktop") image_path = os.path.join(desktop_path, "generated_image.jpg") # Check if the image exists if not os.path.exists(image_path): print("Image not found on the desktop!") return # Step 3: Set the identified image as a screensaver["feh", "--bg-scale", image_path]) print("Screensaver set successfully!") except Exception as e: print("Error:", e) # Schedule the set_screensaver function to run every hour schedule.every() # Keep the script running to allow the scheduled task to execute while True: schedule.run_pending() time.sleep(1)

bottom of page