2

Well, looking for manners of manipulate dconf keys without a GUI I realize that, only when correctly setup a dconf schema enables its key management through GSettings CLI.

I also observed that ANY of GNOME extensions I've choose to use (from a 22-item wide list) have done this properly (thus not providing GSettings manipulation). nevertheless, for example, it's just possible to query a dconf key type using gsettings range command, since dconf in itself do not supply one operation for this purpose.

Question

How should a gschema.xml file properly be 'installed' in a dconf storage system?

artu-hnrq
  • 705
  • 1
    if you have gshema.xml file you will typically compile it with the command glib-compile-schemas – PRATAP Jun 04 '20 at 01:32
  • Where should I store compiled file to ensure gsettings cli find it out? – artu-hnrq Jun 04 '20 at 04:20
  • 1
    you need to decide where to store between 2 choices.. as a root /usr/share/glib-2.0/schemas/yourgschema.xml as a local user $HOME/.local/share/glib-2.0/schemas/yourgschema.xml – PRATAP Jun 04 '20 at 05:52
  • it is easier to answer if you show which gschema.xml are not showing... – PRATAP Jun 04 '20 at 05:59
  • 1
    you should not compile until you copy the gschema.xml file to any of the folder said above.. – PRATAP Jun 04 '20 at 06:01
  • Nice! Thanks for the help, PRATAP. It's worked properly. Would you like to formalize an answer? – artu-hnrq Jun 04 '20 at 12:24

1 Answers1

4

If your extension have gschema.xml file.. and after successful installation of the extension, if you dont find the gsetting keys mentioned in the gschema.xml file.. It indicates that the gschema.xml file is not compiled while the installation process..

In such case.. you need to manually compile the gschema.xml which is provided with the extension.

to compile the schemas.. first copy the gschema.xml provided by the extension, to any of the folder mentioned below..

$HOME/.local/share/glib-2.0/schemas/
/usr/share/glib-2.0/schemas/

Where to copy in above two choices is self explanatory.. first one for local or per user based.. second one is global or admin based..

to compile the schemas.. run the below command from the any directory mentioned above.

glib-compile-schemas .

Example:

As a local user

cd $HOME/.local/share/glib-2.0/schemas
glib-compile-schemas .

for global or as a Admin

cd /usr/share/glib-2.0/schemas
sudo glib-compile-schemas .

Note that, In a default installation $HOME/.local/share/glib-2.0/schemas will not be available so you need to create the directories first with below command

mkdir -p $HOME/.local/share/glib-2.0/schemas

Similarly when you delete the extension or you want to remove the gsetting keys..

Delete the file gschema.xml and then run the glib-compile-schemas command.

PRATAP
  • 22,460
  • 2
    Just one observation. Typically the GNOME extensions installed by the user are installed in $HOME/.local/share/gnome-shell/extensions. Here you will find a folder for every extension. Inside every extension folder you'll find s folder called schemas where you find the gschema of that extension. This is the file to copy to $HOME/.local/share/glib-2.0/schemas. This means that usually the gschemas are already available, you should simply put them in the correct folder and compile them. – Lorenz Keel Jun 04 '20 at 13:18