Gnome 3 and ‘switch to workspace 5 and above’ shortcut

As far as desktop environments go, I somehow got stuck in the Gnome 2 days, and when Gnome 3 became a thing, I simply carried on with its fork, Mate. Partially because I was used to it, but more importantly, my home computers were never exactly the cutting edge of computer technology, quite to the contrary, resources were always somewhat scarce, and Gnome 3 was just too resource hungry for me to use it. For that reason, I preferred the already mentioned Mate, or i3wm, which consumed very little resources even on old hardware. To this date, I still have this old Lenovo X201t, which is 11 years old now, but it still makes for a pretty good bed-side laptop, especially because of its convertible nature and stylus (currently, I’m using LXQT there as a good lightweight option).

I really only started using Gnome 3 with RHEL 8 on my business laptop. It’s Lenovo T480s, which is more than generous as far as computing power goes, I’ve had no issues with Gnome 3 whatsoever on this machine. Also, the completely new ergonomic layout of Gnome 3, which I was not really used to, was not such a big issue for me because I’ve been mainly using this laptop for conference calls and documents editing, nothing fancy.

One thing that I really missed, however, was being able to switch between workspaces using the Superkey + a key on the Numpad. It’s a very fast method as you don’t even need to look at the keyboard.

But this turned out to be an issue. As long as you’re using only one or two or three workspaces, it’s very easy to switch between those workspaces in the usual way (Super + PgUp/PgDown), but I’m used to having nine workspaces (each one designated to a different activity) and using the Superkey + number shortcut is by far the fastest way to go about it. So I set out to assign those very same key bindings in Gnome 3, too. But to my surprise, I found out that you can do that for the first four workspaces only, see the “Switch to workspace X” in the Settings:

I did some searching and reading, and not surprisingly, there was a bugzilla reported where I got some very good pointers. It turns out that when this Settings menu got created, the authors assumed that most people don’t use more than four workspaces so they only put setting options for the first four in this menu. I understand that they didn’t want to have too many “Switch to workspace X” items in this menu, but my use case happens to be different. Luckily, the keyboard bindings can be easily set in the CLI. This will show you what the current bindings are:

$ gsettings list-recursively org.gnome.desktop.wm.keybindings | grep switch-to-workspace

and this command will associate the “switch to workspace 5” to the combination of Super key and numeric keypad 5:

$ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "[\"<Super>KP_5\"]"

This is to be repeated for the rest of the workspaces.

Just a note, my RHEL 8 laptop currently has Gnome version 3.32.2. There’s this new shiny Gnome 40 version in Fedora 34, I assume it will work the same way, but will need to give it a try on a Fedora box.