1

I am using Cinnamon 2.8.6 and ubuntu 16.04. I need to set specific image as desktop background. However after google search, I got solution with following commands:

gsettings set org.gnome.desktop.background show-desktop-icons false
gsettings set org.gnome.desktop.background picture-uri file:///home/techy/Downloads/desktop_bg.jpg 
gsettings set org.gnome.desktop.background show-desktop-icons true
gsettings set org.gnome.desktop.background show-desktop-icons false 

After this, background is changed. But I am not able to understand which package is responsible to execute this change ? How the script is actually working ? Is there any other way to do it from terminal ?

d a i s y
  • 5,511
techy
  • 127
  • All of these are (among other) shell commands so this is a way to do it from terminal (and imho the most elegant one). What "other" way are you looking for? Also org.gnome.desktop.background show-desktop-icons is not related to the desktop background wallpaper. – David Foerster Dec 30 '16 at 09:16
  • I want to know which script is responsible to load the background image after reboot. Is there any documentation like, how cinnamon or gnome desktop managers interact with ubuntu files to change the desktop wallpaper ? – techy Dec 30 '16 at 09:23

1 Answers1

3

To understand what these commands do let's follow the thread.

  1. man gsettings says

    GSettings configuration tool

    but what is "GSettings"?

  2. On https://wiki.gnome.org/HowDoI/GSettings I found:

    GSettings are a nice way to manage your application’s settings.

    Ok, that's a little better because it describes the high-level purpose but it's still very vague.

  3. Let's go back to man gsettings. The usage of the gsettings set command is described like this:

    gsettings set SCHEMA [:PATH] KEY VALUE

    So GSettings appears to be some kind of key-value store with hierarchical key schemata.

    To summarize, the command

    gsettings set org.gnome.desktop.background picture-uri file:///home/techy/Downloads/desktop_bg.jpg
    

    will assign the value file:///home/techy/Downloads/desktop_bg.jpg to the key picture-uri belonging to the schema org.gnome.desktop.background.

  4. Now what happens when that value is (re-)assigned? Here's another gsettings command:

    monitor SCHEMA [:PATH] [KEY]

    Monitors KEY for changes and prints the changed values. If no KEY is specified, all keys in the schema are monitored. Monitoring will continue until the process is terminated.

    So applications can monitor schemata and keys for changes.

    Apparently the process responsible for drawing the desktop background wallpaper monitors this key and reacts to changes by drawing the image in the file referenced in the picture-uri value. Usually the desktop compositor of your desktop environment is responsible for that. In your case that would be Cinnamon but other people might have Gnome Shell or MATE or Unity.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
  • Thanks for the explanation. Can you give reference to some documentation about the error:

    (process:15247): dconf-WARNING **: failed to commit changes to dconf: Cannot autolaunch D-Bus without X11 $DISPLAY

    – techy Dec 30 '16 at 11:45
  • http://askubuntu.com/questions/866195/ubuntu-gnome-desktop-change-wallpaper

    created new question.

    – techy Dec 30 '16 at 15:50