Configuring MATE Defaults

Amazon Linux WorkSpaces uses the MATE Desktop Environment by default. If you're creating a custom bundle for your organization, you may want to change some settings and have those settings apply by default to any workspaces created from that bundle. On Windows the user profile is copied to the default profile when you create an image, but on Linux only the root volume becomes part of the new image, so you'll need to know how to set those defaults on the system.

GSettings / DConf

Most of the settings in MATE (and in GNOME) are stored using GSettings. DConf is the database backend behind GSettings. You can think of it as something roughly equivalent to the Windows Registry. There's a document from the GNOME Project describing a bit about how to use DConf to set local defaults and mandatory settings. It's worth noting that DConf itself doesn't process any schema, so it's easy to make mistakes that could cause software to misbehave. On the other hand, GNOME documentation recommends using DConf over GSettings overrides because /usr may be read-only on some systems. DConf can also allow you to lock specific settings.

Inspecting Local Changes

Before making any changes to your desktop, capture a dump of all settings as they are by default already.

gsettings list-recursively | sort > gsettings.before

After making your changes, for example changing the wallpaper, capture another dump of the settings and compare them.

gsettings list-recursively | sort > gsettings.after
diff -U0 gsettings.{before,after}
--- gsettings.before    2018-12-07 12:14:34.052711800 -0800
+++ gsettings.after 2018-12-07 12:16:27.017519406 -0800
@@ -1117 +1117 @@
-org.mate.background picture-filename '/usr/share/backgrounds/amazon/workspaces-wireframe.svg'
+org.mate.background picture-filename '/usr/share/backgrounds/amazon/Amazon-WorkSpaces-4.jpeg'

In this example there are no additional differences than the one I want, but there may be if you've been clicking around much. Or you might have several changes you want to use.

Adding DConf Overrides

Local DConf overrides are stored under /etc/dconf/db/local.d/ in a format similar to (but not quite) .ini. Section names in the file refer to the schema path, not the schema name. You can get the schema path from the .gschema.xml file.

grep -F path= /usr/share/glib-2.0/schemas/org.mate.background.gschema.xml
<schema id="org.mate.background" path="/org/mate/desktop/background/">

In the above example org.mate.background has a schema path of /org/mate/desktop/background/ so you'd use org/mate/desktop/background as the section name.

[org/mate/desktop/background]
picture-filename='/usr/share/backgrounds/amazon/Amazon-WorkSpaces-4.jpeg'

After you've placed a file like the above under /etc/dconf/db/local.d/ you need to also update the DConf database. This will cause it to process any overrides and save them into the binary database format it uses.

dconf update

Resetting to Defaults

You'll want to see what everything looks like once you're done, to make sure it worked, so it's useful to reset all your local settings back to the newly configured system defaults in your own session. Most software will reconfigure immediately, but some could require you to logout first.

dconf reset -f /

Comments !

social