Skip to content

Instantly share code, notes, and snippets.

@ids1024
Last active August 6, 2020 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ids1024/dc77543876b75659bc7a20bc21184c41 to your computer and use it in GitHub Desktop.
Save ids1024/dc77543876b75659bc7a20bc21184c41 to your computer and use it in GitHub Desktop.

Gnome Shortcuts With Multiple Default Bindings

switch-to-workspace-up: ['<Super>Page_Up', '<Control><Alt>Up']
switch-to-workspace-down: ['<Super>Page_Down', '<Control><Alt>Down']
switch-group: ['<Super>Above_Tab', '<Alt>Above_Tab']
switch-group-backward: ['<Shift><Super>Above_Tab', '<Shift><Alt>Above_Tab']
switch-applications: ['<Super>Tab', '<Alt>Tab']
switch-applications-backward: ['<Shift><Super>Tab', '<Shift><Alt>Tab']
unmaximize: ['<Super>Down', '<Alt>F5']
move-to-workspace-up: ['<Super><Shift>Page_Up', '<Control><Shift><Alt>Up']
move-to-workspace-down: ['<Super><Shift>Page_Down', '<Control><Shift><Alt>Down']
switch-input-source: ['<Super>space', 'XF86Keyboard']
switch-input-source-backward: ['<Shift><Super>space', '<Shift>XF86Keyboard']
help: ['', '<Super>F1']
next-static: ['XF86AudioNext', '<Ctrl>XF86AudioNext']
play-static: ['XF86AudioPlay', '<Ctrl>XF86AudioPlay']
previous-static: ['XF86AudioPrev', '<Ctrl>XF86AudioPrev']
volume-down-static: ['XF86AudioLowerVolume', '<Ctrl>XF86AudioLowerVolume']
volume-up-static: ['XF86AudioRaiseVolume', '<Ctrl>XF86AudioRaiseVolume']
volume-down-quiet-static: ['<Alt>XF86AudioLowerVolume', '<Alt><Ctrl>XF86AudioLowerVolume']
volume-up-quiet-static: ['<Alt>XF86AudioRaiseVolume', '<Alt><Ctrl>XF86AudioRaiseVolume']
volume-down-precise-static: ['<Shift>XF86AudioLowerVolume', '<Ctrl><Shift>XF86AudioLowerVolume']
volume-up-precise-static: ['<Shift>XF86AudioRaiseVolume', '<Ctrl><Shift>XF86AudioRaiseVolume']
touchpad-toggle-static: ['XF86TouchpadToggle', '<Ctrl><Super>XF86TouchpadToggle']
rotate-video-lock-static: ['<Super>o', 'XF86RotationLockToggle']
hibernate-static: ['XF86Suspend', 'XF86Hibernate']
rfkill-static: ['XF86WLAN', 'XF86UWB', 'XF86RFKill']

import xml.etree.ElementTree as ET
from urllib.request import urlopen
import json
FILES = [
"https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/raw/master/schemas/org.gnome.desktop.wm.keybindings.gschema.xml.in",
"https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/raw/master/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in",
]
MSG = "Gnome Shortcuts With Multiple Default Bindings"
print(MSG)
print('-' * len(MSG))
for url in FILES:
bindings = urlopen(url).read()
bindings = ET.fromstring(bindings)
for schema in bindings.findall('schema'):
for key in schema.findall('key'):
key_name = key.get('name')
key_type = key.get('type')
if key_type == 'as':
default = json.loads(key.find('default').text.replace("'", "\""))
if len(default) > 1:
print(f"**{key_name}**: `{default}` ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment