Hi, I am using Gnome again after over a decade. I am happy with the overall experience that Gnome provides for which I thank everyone involved with the project. I’m facing few issues and in this post I would like to specifically talk about an issue with keyboard shortcuts.
The default key bindings Super+PageDown and Super+PageUp to switch to workspace on the right and left respectively doesn’t suite my need. PageUp and PageDown keys on my Thinkpad T420’s seven row keyboard are located far away from the home row. I have to always lift and move my right hand to reach PageUp/PageDown located at the top right corner. I use multiple workspaces all the time and frequently switch between them using keyboard shortcuts so reaching out to PageUp/PageDown soon became cumbersome. Furthermore, the PageDown key itself is problematic on my laptop as it sometimes doesn’t register key press. I used i3wm for well over a decade and used key bindings Super+n and Super+p to switch to next and previous workspace respectively. Super+n and Super+p feels more natural(n for next and p for previous), easy to remember, comfortable to use, and located at predictable location on any keyboard. Location of PageUp/PageDown varies depending on the keyboard layout. Therefore, I changed the default key binding in Gnome from Super+PageDown to Super+n (for next workspace i.e. workspace to the right), and Super+PageUp to Super+p (for previous workspace i.e. workspace to the left).
I thought I was all set except for one problem that frustrated me for months. Post system boot or reboot, hitting Super+n always switched to the workspace on the right but Super+p almost never switched to the workspace on the left. I said “almost never” because once in a while Super+p worked after system boot or reboot but most of the time hitting Super+p did nothing. I thought may be some installed extension was using Super+p so I disabled all extensions and rebooted but the issue persisted. I searched for the string Super+p in Keyboard Shortcuts window and confirmed that Super+p is not associated to anything else but ‘Switch to workspace on the left’.
I really needed Super+p to switch to workspace on the left so I tried few different things and observed the following :
-
Super+p works and switches to workspace on the left after re-logging to the Gnome session. Sometimes I have to relog once, while at other times, I have to relog two or more times to get it working. Sometimes Super+p will either start or stop working after system suspend/resume cycle.
-
Disabling and enabling extensions, specifically Space Bar extension makes Super+p work as expected and I’ve been using this method as a workaround since Gnome 45.
All in all, behaviour of Super+p is unpredictable, inconsistent and quiet frustrating. I suspected the problem was likely due to key binding conflict but I wasn’t able to pinpoint the source of the issue, until only recently, I learned about the command gsettings. I ran the following command and found a suspect.
$ gsettings list-recursively | grep ‘p\b’
org.gnome.desktop.wm.keybindings switch-to-workspace-left [‘p’]
org.gnome.mutter.keybindings switch-monitor [‘p’, ‘XF86Display’]
Using dconf editor I changed the key binding for switch-monitor from Super+p to Super+Shift+p and this permanently resolved the issue. Now, no matter the scenarios, Super+p always switches to workspace on the left because there is no key binding conflict.
When a shortcut is entered in ‘Set Shortcut’ window of the Settings app, the user is informed if there is a conflict. However, there is no such information/warning when I bind Super+p to ‘Switch to workspace on the left’ or to any other action. The action switch-monitor(switch monitor configurations) is not visible/available under Keyboard Shortcuts window of the Settings app, so Settings app isn’t aware of Super+p being already used for switch-monitor?. This is probably why it allows Super+p to be set as a shortcut without informing/warning the user of the hidden conflict?.
Hardware Model - Lenovo ThinkPad T420
OS Name - Fedora Linux 40 (Workstation Edition)
GNOME Version - 46
Thank you.