This script sets your GNOME background to the inverted version of the latest XKCD comic in 20ish lines of Python.
Prerequisites:
pip install requests bs4
Download the script, and add the following line to crontab -e
to fetch the photo every three hours: