Background:
I’m using Bazzite Linux, Gnome, Wayland. As the title states, I’m trying to list my existing custom keyboard shortcuts. I know I can go to Settings > Keyboard > Keyboard Shortcuts > View and Customize Shortcuts > Custom Shortcuts. I want to list my custom shortcuts in Terminal using gsettings
.
I’ve gotten as far as listing the names of the custom shortcuts:
me@fedora:~$ gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings
['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/']
How do I use this info to list the specific details (name, shortcut, command) of the first keyboard shortcut?
What I’ve tried so far:
I’ve tried following examples from the answers in this Ask Ubuntu post from March 2015, and I’ve tried turning to Duck.ai for help. I’m just not connecting the dots between the documentation I’ve read and what I’m trying to do.
me@fedora:~$ gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings/custom0
No such key “custom-keybindings/custom0”
me@fedora:~$ gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybindings:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0 name
No such schema “org.gnome.settings-daemon.plugins.media-keys.custom-keybindings”
me@fedora:~$ gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name
Usage:
gsettings [--schemadir SCHEMADIR] get SCHEMA[:PATH] KEY
Get the value of KEY
Arguments:
SCHEMADIR A directory to search for additional schemas
SCHEMA The name of the schema
PATH The path, for relocatable schemas
KEY The key within the schema
What am I doing wrong?
EDIT: Thank you, @nmtake@lemm.ee, for your help!
The SCHEMA:PATH part seems slightly wrong (singular vs. plural). Try:
schema=org.gnome.settings-daemon.plugins.media-keys.custom-keybinding path=/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ gsettings get "${schema}:${path}" binding gsettings get "${schema}:${path}" command gsettings get "${schema}:${path}" name
You’re right, thank you!
For example:
me@fedora:~$ gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'Terminal'