# Workspace grid for Cinnamon

Categories:

Updated:

I usually work with many windows open at the same time. Say, writing something in $\LaTeX$ means having editor and a couple of PDF-viewer windows open; throw in browser, reference manager, a terminal or two, and you easily end up at 8-10 windows. Unfortunately, switching between as many as 5 on a single workspace is already rather tedious, be it by clicking and dragging, or by Alt-Tabbing your way around. One would think that a good window manager, Cinnamon being an example of such, should allow to fix this.

For some reason though, Cinnamon only provides left/right inter-workspace motions out of the box; I find it more natural to think of the workspaces as sitting on a 2d grid. Apparently, there are people sharing this sentiment: a quick search reveals a discussion on unix stackexchange, where somebody mentions using 16(!) workspaces. Besides, there already is an applet that purports to do precisely what I want; the fact that it conflicts with Expo and does not allow to move windows around makes it somewhat suboptimal.

The suitable solution hack was to write a basic wrapper around wmctrl in Python and to tie shortcuts to it using the Cinnamon config. There is also xdotool, which would probably do the trick as well.

Enabling the “grid” option in Expo further means being able to get an overview of all the windows like so:

I must add that my default config only includes 4 workspaces; nothing outrageous like shown here. The wmctrl allows to both jump between workspaces and move windows around:

wspacetorus.py -d up

wspacetorus.py -t left

etc., with “-d” for “desktop” and “-t” for “to (desktop)” performing jumping and moving the active window in the specified direction. The script is below and in the repo. I imagine it would run on any WM compatible with wmctrl so, according to the manpage, any “EWMH/NetWM compatible X Window Manager”.