Skip to content

Instantly share code, notes, and snippets.

@elgalu
Created January 22, 2016 14:38
Show Gist options
  • Save elgalu/17632e697169e6510a0b to your computer and use it in GitHub Desktop.
Save elgalu/17632e697169e6510a0b to your computer and use it in GitHub Desktop.
Sample custom key bindings through dconf-tools cli
# requirements
sudo apt-get install -qyy dconf-tools
# careful, if you already have custom hotkeys this commands will overwrite the first 7 ...
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name "'SouthWest(7)0,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding "'<Primary><Super>a'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command "'wmctrl -r :ACTIVE: -e 7,0,1080,-1,-1'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/name "'SouthEast(9)1920,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/binding "'<Primary><Super>d'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/command "'wmctrl -r :ACTIVE: -e 9,1920,1080,-1,-1'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/name "'Width1044'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/binding "'<Primary><Super>w'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/command "'wmctrl -r :ACTIVE: -e 0,-1,-1,1044,-1'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/name "'Height768'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/binding "'<Primary><Super>h'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/command "'wmctrl -r :ACTIVE: -e 0,-1,-1,-1,768'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/name "'WinSize1044x768'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/binding "'<Primary><Super>i'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/command "'wmctrl -r :ACTIVE: -e 0,-1,-1,1044,768'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/name "'NorthWest(1)0,0'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/binding "'<Primary><Super>1'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/command "'wmctrl -r :ACTIVE: -e 1,0,0,-1,-1'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/name "'NorthEast(3)1920,0'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/binding "'<Primary><Super>3'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/command "'wmctrl -r :ACTIVE: -e 3,1920,0,-1,-1'"
# enable them, careful this will disable custom7, custom8 and so on unless you include them, if you have those
c0="'/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/'"
c1="'/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/'"
c2="'/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/'"
c3="'/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/'"
c4="'/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/'"
c5="'/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/'"
c6="'/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings "[$c0, $c1, $c2, $c3, $c4, $c5, $c6]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment