5

I currently use shortcuts Super+F1 to Super+F6 to switch over my six workspaces. It was possible in Ubuntu 16.04 (System -> Keyboard -> Navigation) but in 18.04, we can define shortcuts for only 4 wokspaces by default.

How can I increase this default workspaces number in shortcuts parameters ?

pomsky
  • 70,557

2 Answers2

9
  1. First, you will need to increase the number of static workspaces. You can do that on the "Workspaces" tab in GNOME Tweaks (not installed by default). You can also use the terminal to change that configuration:

    gsettings set org.gnome.mutter dynamic-workspaces false
    gsettings set org.gnome.desktop.wm.preferences num-workspaces 6
    

    These commands disable dynamic workspaces, and set the number of workspaces to 6.

  2. You then can set hotkeys to switch to any workspace including workspaces higher than four, using dconf-editor, or, much more convenient in this case, using the terminal.

    gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['<Super>5']"
    gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-5 "['<Super><Shift>5']"
    

    These two comments will set up Super+5 to move to workspace 5, and Super+Shift+5 to move a window to workspace 5. Replace workspace-5 by workspace-6 and higher to set for higher

pomsky
  • 70,557
vanadium
  • 97,564
0

To build upon @vanadium's answer, you also need to remove any conflicting bindings. Otherwise, as I found out, the new keybindings may not work.

For example, I like to use "['<Alt>Fn']" to switch to workspace n` (1 to 12, one for each function key). But some of these shortcuts conflict with default ones.

Here is how to get the list, as per this answer (in my case of using <Alt>Fn):

gsettings list-recursively org.gnome.desktop.wm.keybindings | grep '<Alt>F' | grep -v 'switch-to-workspace'

In the default keybindinds, I see e.g. begin-resize, begin-move, etc.

Remove those with, e.g.:

gsettings set org.gnome.desktop.wm.keybindings begin-resize "[]"

Then, set all your workspace switching shortcuts at once:

for i in {1..12}; do echo $i; gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-$i "['<Alt>F$i']"; done

Then it all works.

Pierre D
  • 111