Wallpaper / desktop background + other stuff on Linux Mint 18.1 / Cinnamon

This post was written by eli on February 20, 2017
Posted Under: cinnamon,Linux,Software

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)

Messing up with other Window Manager

One way to completely mess up is running /etc/X11/Xsession through an ssh -X session with another computer. This will cause an attempt to start a full desktop session on the ssh client’s  X server, where an existing desktop already exists. A whole lot of attributes will be changed, for example the wallpaper, font settings and the windows’ title bars become rock-bottom basic and ugly. Apparently, these settings are made directly on the X server, so restarting Cinnamon doesn’t help. It’s the X server that needs restarting.

So the good news is that a messup of this sort doesn’t affect the permanent setting. A simple reboot fixes this. The bad news are, of course, that a reboot is necessary. Or maybe restarting the X server will be enough. Didn’t check this option.

Why I would run /etc/X11/Xsession is a different story. If I do, it’s best not to forget the DISPLAY= assignment…

Reader Comments

This is Great

#1 
Written By komodoDragon on February 3rd, 2021 @ 14:41

Add a Comment

required, use real name
required, will not be published
optional, your blog address