Hello all

There's an easy way to provide distribution defaults for GNOME 3 and
apps that use GSettings (or, say, dconf, the backend), as described in
http://www.burtonini.com/blog/computers/gsettings-override-2011-07-04-15-45.

I have tried successfully the following.

Create file /usr/share/glib-2.0/schemas/lols.gschema.override
(the extension .gschema.override is what matters here) with content:

-cut here-
[org.gnome.FileRoller.UI]
view-toolbar=false

[org.gnome.shell.clock]
show-date=true
show-seconds=true

[org.gnome.shell.calendar]
show-weekdate=true

[org.gnome.desktop.background]
picture-uri='file:///usr/share/backgrounds/sabayonlinux.png'
-cut here-

- these are example settings (also note how the wallpaper can be
changed - works for GNOME Shell and in the fallback mode).

Then (as root):
glib-compile-schemas .
(/usr/share/glib-2.0/schemas was my CWD, otherwise
glib-compile-schemas /usr/share/glib-2.0/schemas).

Done.

As user (after creating a backup of the directory, no worries!):
cd ~/.config; killall dconf-service && rm -r dconf,
log in / start app,
and the changes were applied.

Notes.
- dconf-editor didn't see (check boxes) defaults that were set this
way (and I think it did the first time), but everything else, the
applications (File Roller, GNOME Shell) used the settings correctly.
Looks like a bug in dconf-editor - I'll take a look later. Minor
thing, IMO.
- This "mechanism" sets/changes settings if user didn't make any
change to a setting yet. In other words, it didn't override my
settings after I changed them (for example toolbar on/off in
FileRoller).
- Sabayon can provide such config file in a separate package or as a
part of any existent, with gnome-base/dconf and
gnome-base/gsettings-desktop-schemas in DEPEND.
- As far as I can see, if we want to provide ABCDEF's settings, the
app doesn't need to be already installed for the changes to take place
after installing ABCDEF (tested where ABCDEF = GNOME Shell), thus -
package providing distro settings for ABCDEF doesn't need to have
ABCDEF in DEPEND.
- Actually all or most packages using this stuff is supposed to call
glib-compile-schemas in pkg_postinst/rm: gnome-base/gnome-shell too,
which may be the reason why the above point is true.
- After all, I think this "mechanism" looks pretty nice...

SN

Reply via email to