@@ -0,0 +1,1106 @@
+import os%0Aimport requests%0Aimport json%0A%0A# Perform a GET to Bing's wallpapers API%0Aurl = 'https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US'%0Aresponse = requests.get(url)%0A%0Adata = json.loads(response.text)%0Aimage_url_pathname = data%5B'images'%5D%5B0%5D%5B'url'%5D%0Aimage_filename = image_url_pathname%5B16:%5D%0A%0Alocal_images_dir = os.path.expanduser('~') + '/Pictures/wallpaper/'%0Alocal_images = os.listdir(local_images_dir)%0A%0A# Check if the current background is not the same as Bing's%0Aif not local_images or (local_images and (local_images%5B0%5D != image_filename)):%0A    image_url = 'https://www.bing.com' + image_url_pathname%0A%0A    # Perform a GET to the image URL%0A    image = requests.get(image_url).content%0A%0A    with open(local_images_dir + image_filename, 'wb') as handler:%0A        handler.write(image)%0A%0A    gsettings_command_str = (%0A        '/usr/bin/gsettings set org.gnome.desktop.background picture-uri ' +%0A        '%22file://' + local_images_dir + image_filename + '%22'%0A    )%0A    os.system(gsettings_command_str)%0A%0A    # Remove old image if it exists%0A    if local_images:%0A        os.remove(local_images%5B0%5D)%0A

Add background.py