How can I install gsettings schema via a gnome shell extension?
Solution 1
From everything I've been able to find (google and gtk docs), it seems that you've hit on exactly the reason why extensions installed via web browser can't store settings via dconf/GSettings - you have to install dconf schemas at the system level. There doesn't appear to be a way to have per-user schemas - dconf only uses the single compiled binary file.
The statement about adding support for this in Gnome 3.4 leads me to beleive they are going to a) implement an alternate method for extensions to store settings, or b) extend GSettings/dconf in a way that allows users to install/compile schemas under $HOME.
If anyone can confirm this (or refute it, with pointers to documentation), I, and many others I'm sure, would appreciate it.
This post mentions the limitation, but doesn't explain exactly why... http://www.ubuntubuzz.com/2011/12/gnome-shell-extensions-website-has-been.html
Solution 2
Currently, you can't. This is not even an extensions limitation, but rather a core one: there is no method in the GSettings library for programatically compiling schemas. You really need to use the command line tool for that.
And manually copying your schema to ~/.local/glib-2.0/schemas
and compiling it there does not work by default because GSettings searches for schemas in the directories listed on the XDG_DATA_DIRS
environment variable. If you add ~/.local/glib-2.0/schemas
to XDG_DATA_DIRS
it should work.
Related videos on Youtube
Otaj
Updated on September 18, 2022Comments
-
Otaj over 1 year
I started to write my own Gnome Shell Extensions and can't find any answer to this question -> is there any way, how to install gsettings schema on machine just via extension code (e.g. not copying schema.xml into
glib-2.0/schemas
directory and compiling by terminal)?If I try to "make" access to not-installed schema it starts crashing and looking glass keeps telling that such a schema doesn't exist. It's really uncomfortable for potential users who wants to install those extensions.
-
Zanna over 7 years
-
-
Otaj over 12 yearsWell, I know that gnome shell extensions web can't install schemas (one of reasons why my extension was rejected), I actually think that it's because on system level -> I know that when I tried to add my schema into ~/.local/glib-2.0/schemas/ and compile it there, nothing was able to load it. But that's everything what I know about it