Is there a way to map a shortcut to go to the previously visited workspace?
-
1version of ubuntu? Please [edit] your question accordingly – graham May 02 '22 at 09:29
1 Answers
For Ubuntu versions up to 21.10 (GNOME 40)
You can use the Go To Last Workspace extension. Just install it and you should be able to use the keyboard shortcut Super+Esc to switch between the last two workspaces you used.
You may also want to read this: How do I install and manage GNOME Shell extensions?
For Ubuntu 22.04 (GNOME 42)
The extension isn't updated (yet?) to support Ubuntu 22.04 (GNOME 42). It can be made to work, though, by following these steps:
Go to the extension's GitHub page and download it as zip (click here to directly download the zip).
Open the location where you downloaded the zip and extract it.
Open the
metadata.json
file inside the extracted directory and change the line:"version": 7,
to:
"version": 8,
Also change the line:
"shell-version": ["40", "3.38", "3.36", "3.34", "3.32", "3.30", "3.28"],
to:
"shell-version": ["42", "40", "3.38", "3.36", "3.34", "3.32", "3.30", "3.28"],
We just added support for GNOME 42. ;)
Now copy the extracted directory to
~/.local/share/gnome-shell/extensions
and change its name tognome-shell-go-to-last-workspace@github.com
.Run the following command to set the keyboard shortcut to switch between workspaces.
gsettings --schemadir ~/.local/share/gnome-shell/extensions/gnome-shell-go-to-last-workspace@github.com/schemas set org.gnome.shell.extensions.go-to-last-workspace shortcut-key "['<Super>escape']"
In the above I'm using the default Super+Esc shortcut, but you may adjust the above command for the shortcut of your choice.
Now restart GNOME Shell by pressing Alt+F2, entering
r
and pressing Enter (works on Xorg only), or log out and log back in (works on both Xorg and Wayland).The extension should now be enabled and you should be able to use Super+Esc to switch between the last two visited workspaces.
You may also want to install the Extension Manager so you can easily enable/disable extensions using the following command:
sudo apt install gnome-shell-extension-manager

- 8,905

- 14,585
-
Thanks it works but how can i map it to Alt+Tab it doesn't allow me to set it trough the extension manager. – Jerico May 04 '22 at 12:28
-
1@Jerico I guess you first have to unassign the
Alt
+Tab
shortcut by going to Settings > Keyboard > Kyeboard Shortcuts. Then search for Switch windows, click the shortcut and pressBackspace
. Then try the command in the answer to set the shortcut you wish. – BeastOfCaerbannog May 04 '22 at 13:53