/daily-wallpaper

Wallpaper of the Day. This is a simple Python script for Mac Big Sur+ that will download a NASA or Bing image of the day and set it as the desktop wallpaper. It can be scheduled using crontab.

Primary LanguagePython

Wallpaper of the Day

This wallpaper of the day script is a single Python 3.9+ script. It supports: - macOS Big Sur+ - ubuntu 20.04+ - windows 10, 11 It downloads from one of these sources: - a NASA, - Astronomy Picture Of the Day (apod) or - Bing image of the day from the appropriate RSS feed, and sets it as the desktop wallpaper. It also prints a description of the image to the console and creates a notification describing the image.

Installing

Make sure you have python 3.9+ in your path. Add the bs4 package (BeautifulSoup) to your environment. This is used to parse the NASA Astronomy Picture of the Day, which is a web page rather than an RSS feed. Also need the requests package.

If you use pip, you would install it like this:

pip install bs4 requests

Usage

Running is as simple as:

python wallpaper.py
python wallpaper.py [--mode nasa|apod|bing]

Although of course you may in practice want to specify the path to the script. To get the APOD picture of the day instead of the NASA picture, which tends to have more images of galaxies:

python wallpaper.py --mode apod

To obtain the bing picture of the day:

python wallpaper.py --mode bing

Scheduling

It can be scheduled using crontab as follows, at the command line:

crontab -e

then, enter the following data to run it at 9am each day:

0 9 * * * ~/venv/bin/python ~/Documents/GitHub/daily-wallpaper/wallpaper.py

This example uses a virtual environment. But you can specify whatever python you like as long as it uses python 3.9 or above. For more help with cron, check out https://crontab.guru/

The pictures are downloaded to the directory:

~/Pictures/DeskFeed/