Configure gnome-shell extensions from command line

Found the answer by myself in the end.

sudo cp ~/.local/share/gnome-shell/extensions/extname/schemas/org.gnome.shell.extensions.extname.gschema.xml \
    /usr/share/glib-2.0/schemas/ &&
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/

Copy and compile the schemas in ~/.local/share/gnome-shell/extensions and gsettings will be able to work with them.


In CentOS 7 - and I would think in Ubuntu also - I've identified what I think is a slight improvement on the accepted answer by introducing the --schemadir switch as follows:

# gsettings --schemadir ${schemaDir} set ${schema} ${key} "${value}"

In the above command gsettings directly sets ${key} to ${value} in ${schema} where ${schema} does not reside in the default /usr/share/glib-2.0/schemas directory. (and there is no requirement to move the schema to the default directory)

Some examples:

gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]/schemas/ list-recursively org.gnome.shell.extensions.org-lab21-putwindow
gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]/schemas/  list-recursively org.gnome.shell.extensions.app-keys
gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]/schemas/  list-recursively org.gnome.shell.extensions.emoji-selector