Windows – How to set a website with live information as desktop wallpaper

desktop-customizationUbuntuwindows 10

Here is a great map of the Earth showing live information about winds and temperature.

Is it possible to set this as a desktop background with automatic updating every few hours (the map itself updates every three hours)?

This question is similar in spirit: How can I set the live video feed from the ISS as my desktop background?.

I am using Windows 10 and Ubuntu, but I'll keep the question more general.

EDIT:
The program WallpaperWebPage has the right idea, but with the following limitations:

  • it covers desktop icons
  • it is interactive (so when you click on the desktop it behaves like a browser)
  • it only covers the desktop and can be minimised
  • the map needs a modern browser and this basically runs an old version of IE in full screen mode

Best Answer

On Ubuntu I use variety. It's "an automatic wallpaper changer, downloader and manager".

It can pull pictures from an RSS feed and automatically update your desktop.

Therefore, I'd imagine that if you setup an RSS feed that takes a screen shot of your website every x hours and hooked variety to it you'd have a solution.

I do not actually know how to set up a RSS feed but if you have any questions about variety let me know.

Edit:

Here is an other way to do what you want.

  1. Run sudo apt-get install libqt5webkit5 python3-pyqt5.qtwebkit python3-pyqt5 python3 to install required libraries
  2. Setup a file with the following python3 code. This code takes a screen shot from WEBSITE_URL and updates your Ubuntu desktop.

    import sys
    import time
    import os
    from PyQt5.QtCore import *
    from PyQt5.QtGui import *
    from PyQt5.QtWidgets import *
    from PyQt5.QtWebKitWidgets import *
    
    WEBSITE_URL='https://earth.nullschool.net/#current/wind/surface/level/overlay=temp/winkel3'
    OUT_FILE="websiteScreenshot.png"
    
    class Screenshot(QWebView):
        def __init__(self):
            self.app = QApplication(sys.argv)
            QWebView.__init__(self)
            self._loaded = False
            self.loadFinished.connect(self._loadFinished)
    
        def capture(self, url, output_file):
            self.load(QUrl(url))
            self.wait_load()
            # set to webpage size
            frame = self.page().mainFrame()
            self.page().setViewportSize(frame.contentsSize())
    
            # render image
            image = QImage(self.page().viewportSize(), QImage.Format_ARGB32)
            painter = QPainter(image)
            frame.render(painter)
            painter.end()
            print ('saving', output_file)
            image.save(output_file)
    
        def wait_load(self, delay=5):
            # process app events until page loaded
            while not self._loaded:
                self.app.processEvents()
            t_end = time.time() + delay
            while time.time() < t_end:
                self.app.processEvents()
            self._loaded = False
    
        def _loadFinished(self, result):
            self._loaded = True
    
    s = Screenshot()
    s.capture(WEBSITE_URL, OUT_FILE)
    
    #Update your background
    workingDir=os.path.dirname(os.path.realpath(__file__))
    os.system("gsettings set org.gnome.desktop.background picture-uri file://"+workingDir+"/"+OUT_FILE)
    
  3. In "Startup Applications" press add and type watch -n 3600 python3 yourfilepath under command. Replace yourfilepath with the path to where you saved the pythonscript. This will run the script every 3600 seconds = 1 hour.

Note the delay variable in the wait_load function. Increase it's value if the web page doesn't have time to load.

Related Question