You are not logged in.

#1 2015-07-27 17:36:29

Sam_DM
Member
Registered: 2014-03-09
Posts: 13

Gnome extended keybindings

I am using the Gnome shell and I have keybindings setup as:

Switch to workspace 1 => super+1
Switch to workspace 2 => super+2
Switch to workspace 3 => super+3
Switch to workspace 4 => super+4

I set these using the settings GUI in the gnome shell.

What I would like to do is add additional keybindings up to 8 workspaces, but the keyboard settings GUI only shows options for the first 4, so how do I add these extra keybindings?
In addition, it would be nice if I could assign keybindings to switch focus between between windows, and to move windows between the primary and secondary monitor.

Is there some kind of API I could use to programmatically arrange windows?

After some googling I could not find any clear documentation on this subject, if you know a good source of information, feel free to share.

Offline

#2 2015-07-27 23:34:35

Sam_DM
Member
Registered: 2014-03-09
Posts: 13

Re: Gnome extended keybindings

After some more googling, I found a partial answer myself. I'll post it here in case someone else needs this.

Keybindings are stored in a database which can be accessed and modified using the 'dconf' program. Alternatively the database can be changed from the command line using the 'gsettings' command.

To change the keybindings with dconf, open dconf and navigate to 'org.gnome.desktop.wm.keybindings', then edit the value. I have not yet found a specification of what values are possible.
To change the keybindings from the command line:

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>1']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Super>2']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Super>3']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<Super>4']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['<Super>5']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['<Super>6']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-7 "['<Super>7']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-8 "['<Super>8']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-1 "['<Shift><Super>exclam']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-2 "['<Shift><Super>at']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-3 "['<Shift><Super>numbersign']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-4 "['<Shift><Super>dollar']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-5 "['<Shift><Super>percent']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-6 "['<Shift><Super>asciicircum']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-7 "['<Shift><Super>ampersand']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-8 "['<Shift><Super>asterisk']"

This binds navigating to a workspace to super-numkey and moving a window to a workspace to super-shift-numkey

Moving windows to another monitor is specified by the 'move-to-monitor-*' keys. The default values are (which are fine for me):

org.gnome.desktop.wm.keybindings move-to-monitor-left ['<Super><Shift>Left']
org.gnome.desktop.wm.keybindings move-to-monitor-down ['<Super><Shift>Down']
org.gnome.desktop.wm.keybindings move-to-monitor-right ['<Super><Shift>Right']
org.gnome.desktop.wm.keybindings move-to-monitor-up ['<Super><Shift>Up']

Also of note, to quickly find a certain key you can issue the command

gsettings list-recursively | grep "SEARCH TERM"


The only thing missing now are keybindings to switch focus between applications and between monitors. I tried finding such keys by searching for the words 'focus', 'display', 'monitor' and 'screen' but nothing usefull showed up. So any help for this last thing would be appreciated.

Offline

Board footer

Powered by FluxBB