Cycle through workspaces
There is no existing command to cycle through workspaces, but as alway, we can make it.
Run the script below from a convenient shortcut and it will do exactly as you describe: cycle through the existing workspaces. Once the last is reached, it jumps back to the first.
Note That dynamic workspaces needs to be set to
Wnck, we can get information on both the (list of) workspaces, as well as the current one. Subsequently, we can move to any other of the listed workspaces in an organized way.
Please make sure
Wnck is installed:
sudo apt install python3-gi gir1.2-wnck-3.0
Then copy the script below into an empty file, save it as
cycle_workspaces.py, make it executable and run it from a shortcut of your choice. (running:
from gi.repository import Wnck, Gtk
scr = Wnck.Screen.get_default()
# list existing workspaces
workspaces = scr.get_workspaces()
# get the (index of) current one
currws = workspaces.index(scr.get_active_workspace())
# since first in list has index 0, subtract 1, if index is last,
# move to first index of the list (workspaces)
if currws == len(workspaces) - 1:
next_workspace = workspaces
# else pick the next in list
next_workspace = workspaces[currws + 1]
# and activate it...