Ubuntu: Why do I only get half a desktop wallpaper?



Question:

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?


Solution: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.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »