this post was submitted on 14 Apr 2025
21 points (100.0% liked)

Linux

55358 readers
397 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

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, @[email protected], for your help!

top 2 comments
sorted by: hot top controversial new old
[–] [email protected] 6 points 2 months ago (1 children)

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
[–] [email protected] 5 points 2 months ago

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'