Change gnome settings after install

Asked by Horst Baerbel

First of all: Thanks for the awesome project!

I'd like to modify some gnome settings after a successful install, namely:

gsettings set org.gnome.desktop.notifications show-banners false
gsettings set org.gnome.desktop.screensaver ubuntu-lock-on-suspend false
gsettings set org.gnome.desktop.screensaver lock-enabled false

I've tried settings these in the chroot, but that did nothing. The I tried adding a file /etc/xdg/autostart/gnome-initial-setup-gsettings.desktop:

[Desktop Entry]
Name=GNOME Initial Setup Gnome settings
Type=Application
Exec=sh -c "gsettings set org.gnome.desktop.notifications show-banners false; gsettings set org.gnome.desktop.screensaver ubuntu-lock-on-suspend false; gsettings set org.gnome.desktop.screensaver lock-enabled false"
OnlyShowIn=GNOME;
NoDisplay=true
X-GNOME-AutoRestart=false
X-GNOME-Autostart-Phase=WindowManager
AutostartCondition=unless-exists gnome-initial-setup-done
X-GNOME-HiddenUnderSystemd=true
X-Ubuntu-Gettext-Domain=gnome-initial-setup

But it does not seem to be run. What Am I doing wrong?

Question information

Language:
English Edit question
Status:
Solved
For:
Cubic Edit question
Assignee:
No assignee Edit question
Solved by:
Horst Baerbel
Solved:
Last query:
Last reply:
Revision history for this message
Cubic PPA (cubic-wizard) said :
#3

Horst,

I'm glad you got it working.

Also, note that you can "preset" these in Cubic's Terminal environment, so you don't need to do it manually in the Live Environment or after you install your OS.

To set gsettings values globally, you need to modify files in /usr/share/glib-2.0/schemas.

These files are read upon bootup into the Desktop Environment, and the gsettings values are set from them.

As an example, take a look at step "[5] CONFIGURE DEFAULTS" in Comment #6 of this question:

    https://answers.launchpad.net/cubic/+question/692588

In your case, you will need to create a file with a name like:

    /usr/share/glib-2.0/schemas/90_ubuntu-custom.gschema.override

In this file, add the following sections:

    [org.gnome.desktop.notifications]
    show-banners = false

    [org.gnome.desktop.screensaver]
    ubuntu-lock-on-suspend = false
    lock-enabled = false

Then execute:

    glib-compile-schemas /usr/share/glib-2.0/schemas

Revision history for this message
Horst Baerbel (horstbaerbel) said :
#4

Actually, it wasn't working. Not sure why I thought it did... ;)
Thanks for your instructions. With those it worked like a charm!