Shell – Set static number of workspaces in gnome-shell with dconf

dconfgnome-shellgnome3workspaces

How to set the behavior of gnome-shell workspaces (static instead of dynamic) via dconf?

I configured i3 style keyboard shortcuts to switch to specific workspace with Super+<num> but gnome-shell creates workspaces dynamically, so I can not switch directly to 4th workspace to run programs there if workspace 3 and 4 are not created.

Best Answer

As you've found out, you can do this via tweak-tool:

enter image description here

and indeed, the changes are now done in the dconf database so if you prefer doing it in terminal you need to toggle dynamic-workspaces to false and set the desired num-workspaces so either

dconf write /org/gnome/mutter/dynamic-workspaces false
dconf write /org/gnome/desktop/wm/preferences/num-workspaces 4

or

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

Altering those keys can be done also via dconf-editor.