Ubuntu 18.04 ctrl+alt+right/left

In Ubuntu, the hotkeys ctrl+alt+right and ctrl+alt+left have traditionally been the default hotkeys for switching to the next right or left workspace respectively.  However, since Ubuntu 18.04 now uses Gnome Shell, workspaces are only oriented vertically and so there are no left or right workspaces.  Despite this, Ubuntu appears to still bind these keys by default even though their applicable actions no longer have an effect, therefore blocking these key combinations to be used by other applications.  This can be confirmed by running the following commands:

gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-left
gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-right

If, like me, you like to use these keys in your editors or other applications, you can unbind the hotkeys by running the following commands:

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "[]"

Other Keys

If there are other keys that are being blocked like this, you can view the different Gnome keybindings by running:

gsettings list-keys org.gnome.desktop.wm.keybindings

You can then run gsettings get like above with any of these commands to see what keys are bound to them.  Or you can run the following script that will list all of the commands with their bound hotkeys:

COMMANDS=($(gsettings list-keys org.gnome.desktop.wm.keybindings))
NUM=${#COMMANDS[@]}

for ((i=0; i < $NUM; i++)); do
    echo "$i: ${COMMANDS[$i]}"
    echo -en "\t"
    gsettings get org.gnome.desktop.wm.keybindings ${COMMANDS[$i]}
done

 

Leave a comment