Wallpaper / desktop background + other stuff on Linux Mint 18.1 / Cinnamon
Desktop wallpaper setting
Get the current one:
$ gsettings get org.cinnamon.desktop.background picture-uri 'file:///usr/share/backgrounds/linuxmint/default_background.jpg'
And set it to another:
$ gsettings set org.cinnamon.desktop.background picture-uri 'file:///usr/share/backgrounds/linuxmint/edesigner_linuxmint.png'
Notes:
- The “file://” prefix is mandatory.
- There also an org.gnome.desktop.background attribute. Apparently, org.cinnamon.desktop.background overrides the former.
- For an effect on the screen, the “set” command must be run on the active console (i.e. it doesn’t work from an remote ssh session)
- If the URI property is faulty, the actual desktop background reverts to the default, but the faulty value is shown as is with the “get” command. This is somewhat confusing. In particular, omitting the file:// prefix makes a faulty value.
A bit more with gsettings
List all keys and values related to the desktop background:
$ gsettings list-recursively org.cinnamon.desktop.background org.cinnamon.desktop.background picture-uri 'file:///usr/share/backgrounds/linuxmint/edesigner_linuxmint.png' org.cinnamon.desktop.background color-shading-type 'solid' org.cinnamon.desktop.background primary-color '#000000' org.cinnamon.desktop.background picture-options 'zoom' org.cinnamon.desktop.background picture-opacity 100 org.cinnamon.desktop.background secondary-color '#000000'
Or org.cinnamon, for that matter
$ gsettings list-recursively org.cinnamon
And there’s also “reset” for resetting a value to its default, and “monitor”, which prints a line each time the value of a key is changing.
The “org.cinnamon.desktop.background” strings is called a “schema”. These can be listed with:
$ gsettings list-schemas
Or the list of relocatable schemas (don’t ask me what “relocatable” means):
$ gsettings list-relocatable-schemas
These schemas can be found in /usr/share/glib-2.0/schemas/. For example, the schema for the desktop background properties can be found as /usr/share/glib-2.0/schemas/org.cinnamon.desktop.background.gschema.xml.
However the XML files are not in effect directly. Rather, it’s the compiled file, /usr/share/glib-2.0/schemas/gschemas, generated with glib-compile-schemas.
dconf
gsetting is dconf-based, and accesses ~/.config/dconf/user binary database for obtaining non-default values. To dump all values in this database, install the dconf command-line tool:
$ sudo apt-get install dconf-cli
and then
$ dconf dump /
Or shall I be more specific?
$ dconf dump /org/cinnamon/desktop/background/ [/] picture-uri='file:///usr/share/backgrounds/linuxmint/default_background.jpg'
Note that running “gsettings reset” on a key removes it from the dconf database:
$ gsettings reset org.cinnamon.desktop.background picture-uri $ dconf dump /org/cinnamon/desktop/background/ $
(no output)