4

I am trying to modify the Gnome Shell preferences (in this case the key bindings) using the terminal. I have tried:

gsettings set org.gnome.Terminal.Legacy.Keybindings switch-to-tab-1 '<Alt>1'

But it is giving me an error:

Schema 'org.gnome.Terminal.Legacy.Keybindings' is relocatable (path must be specified)

So I am stuck in there. How can I specify the path? Also, I see the word "Legacy" in there... Is there a better way to do this?

Note: Using Fedora 24 with all upgrades: GNOME Shell 3.20.3, GNOME Terminal 3.20.2.

  • I dont know if that helps but maybe (depending on what you will use the keys), i used xbindkeys to create a list of key bindings from command line in some special machines. If you just need to bind keys, with gnome or not, from command line, then xbindkeys is your best and easy choice. – Luciano Andress Martini Jul 22 '16 at 19:22
5

Thanks to @don_crissti's help and the answer they pointed me to.

In order to change Gnome Terminal keybindings a path must be provided for the schema (as it is relocatable). So we need to define both a schema and a path:

GSETTINGS_SCHEMA=org.gnome.Terminal.Legacy.Keybindings
GSETTINGS_PATH=/org/gnome/terminal/legacy/keybindings/
SCHEMA_PATH=$GSETTINGS_SCHEMA:$GSETTINGS_PATH

Then we can easily set our keybindings:

gsettings set $SCHEMA_PATH switch-to-tab-1 '<Primary><Alt>1'
gsettings set $SCHEMA_PATH switch-to-tab-2 '<Primary><Alt>2'
...
gsettings set $SCHEMA_PATH prev-tab '<Primary><Alt>9'

In order to list all the available keybindings (and also to check they are properly set):

gsettings list-recursively | grep Terminal.Legacy.Keybindings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.