2

I've created a neat little script that downloads a JPG using wgetand then sets it as the Unity desktop background with

gsettings set org.gnome.desktop.background picture-uri file:///home/myname/wallpaper.jpg

After running the script, the desktop wallpaper is incomplete but when I open the downloaded image, it is fine! When I manually run the gsettings command, the same thing happens - so I don't think the problem could be that gsettings starts before the image is downloaded completely.

What is causing this odd problem, and how can I fix it?

  • Exhibit A: my neat little script.
  • Exhibit B: My desktop with an incomplete background image:
    enter image description here.
  • Exhibit C: original image url. The trick is that this URL is static but the actual image file is continually refreshed with a different image file. That's why I made my script.
  • Exhibit D: When the desktop is broken, manually setting the wallpaper through the Settings GUI (or desktop right-click) fixes it ... until the cron'ed script runs again.
  • Exhibit E: When the desktop is broken, manually running gsettings set org.gnome.desktop.background picture-uri file:///home/myname/wallpaper.jpg doesn't fix it.
  • Exhibit F: When the desktop is broken, manually running gsettings set org.gnome.desktop.background picture-options zoom doesn't fix it. Nothing seems to happen.
  • Exhibit G: When the desktop is broken, the cached wallpaper is also broken. I came across this very similar topic. Adding rm of the cached file before the gsettings command doesn't solve my problem though; the new cached image is broken too. It almost seems like that gsettings command is broken?

1 Answers1

1

If your purpose is to display the current earth view, you might make use of xplanet, which gets a more frequently updated image.

Install xplanet with -

sudo apt-get install xplanet

Then, in your script replace the image source with the xplanet output as below.

xplanet -body earth -num_times 1 -projection mercator -output $wallpaper_name -geometry 1366x768
(replace geometry parameter value with your screen size).

Now, you will get a more frequently updated image that won't be sliced.

Sri
  • 1,662
  • 2
  • 20
  • 39
  • There's a program that generates these and can be run on the local computer? How cool is that! I'll never not be surprised by the versatility of Linux :D – Torben Gundtofte-Bruun Feb 28 '15 at 07:56
  • Yes, xplanet can run a continuous image update, however your script will allow a more judicious use of personal computer resource. A cron with 15 minute update interval is quite appropriate for personal use :) – Sri Feb 28 '15 at 08:01
  • Your answer doesn't explain the cause of my current problem but provides a fine alternative solution that I want to implement. Thank you! – Torben Gundtofte-Bruun Feb 28 '15 at 08:02
  • Thanks to you too. I changed my desktop/wallpaper to this interesting journey through the day. – Sri Feb 28 '15 at 08:06
  • Now having toyed with xplanet I can't decide whether to use it or not. It does produce a very nice image but the nighttime area seems wrong - too bright and missing city lights. For that, the Opentopia images win. Hmm... – Torben Gundtofte-Bruun Feb 28 '15 at 18:40