Re: Configuring extension keyboard-shortcuts from gnome-control-center





On 30 September 2014 01:44, Matthijs Kooijman <matthijs stdin nl> wrote:
Hey folks,

> AFAIU you can now register new keyboard shortcuts from a shell
> extension, by providing the relevant gsettings schema and calling
> Main.wm.addKeyBinding to provide the handler for the binding.
Digging a bit further, it seems that just adding the schema to the
extension is not enough:
 - Inside the extension, the schema must be explicitely loaded to work.
   It seems convenience.js is commonly used for this. Shouldn't
   gnome-shell just expose some convenient API for its extensions for
   this kind of thing?
It depends on your opinion - in my opinion, gnome-shell *does* expose a convenient API for settings via Gio.Settings and Gio.SettingsSchemaSource, which lets you load the (local) schema (i.e. the getSettings function that just about everyone uses). Or if you like, the getSettings function everyone puts into their convenience.js is the API.
 
 - To edit the settings manually, e.g. through dconf-editor, the schema
   needs to be copied/installed into /usr/share/glib-2.0/schemas (or
   /usr/local/share/glib-2.0/schemas).
   I tried linking them into ~/.local/share/glib-2.0/schemas, but it
   turns out that both dconf-editor and gsettings only use
   get_system_data_dirs, not get_user_data_dir. They do use
   GSETTINGS_SCHEMA_DIR, which could solve things for my current
   usecase, but doesn't really help to make things work out of the
   box...

The whole point with the extensions is that you shouldn't have to install the schema into /usr/share/glib-2.0/schemas to work, the extensions are local. That's the reason the extensions have prefs.js to let you modify the values. And as you have discovered, you can use GSETTINGS_SCHEMA_DIR to edit local settings with dconf-editor if you really want to rather than using the gnome-shell-extension-prefs. "work out of the box" >> the extension author should provide prefs.js and then things will work out of the box, that is the intended way to edit prefs (not through dconf-editor and mixing up local and global installs).
 
Gr.

Matthijs

_______________________________________________
gnome-shell-list mailing list
gnome-shell-list gnome org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]