I'm using 2 workspaces right now, and I'd like to be able to cycle through them using a single shortcut. At the moment, I can do Ctrl+Alt+Right to switch to workspace 2, and Left switches to 1, but I'd like a single key (or key combination) to switch to the workspace I'm not in right now. That way I would only need that shortcut, and not need two.
I'm running Ubuntu on an old machine, and that keeps me from enabling compiz at all. I tried writing a script using both wmctrl
and xdotool
, but neither work properly (no matter what I do, they both will only switch to workspace 1, and never to 2).
Any suggestions?
Here's a script that switches to the next workspace, wrapping back to the first after the last. Note that workspaces are numbered from 0, maybe this is what threw you when you tried writing a script.
i know this is old but here are my versions:
For multiple workspaces (as in Gilles's answer):
For multiple viewports: