How to distribute windows over virtual desktops in Gnome

I have a load of virtual desktops running and I usually have one full screen application per desktop (so sort of like the Ratpoison WM but with an option to use it in other ways when needed). I want new windows to automatically be put in certain desktop numbers when they start up. What's the easiest way to do this?


Solution 1:

If you're using Compiz, install compizconfig-settings-manager, activate the "Place Windows" plugin, and in the "Fixed Window Placement" tab, you can adjust which windows should default to which viewport.

Solution 2:

You might want to take a look at the Devil's Pie tool; it is available in Ubuntu as package devilspie (apt-get install devilspie).

This article and this other one explain some of its prominent features, and provides some example code, including how to move a window to a certain workspace and maximize it.