27 August 2008

Keep One Application Together

One feature of VirtueDesktops that I really liked on OS X was being able to constrain an application to a specific workspace. It turns out Compiz has been able to do this for, well, since Beryl and Compiz became Compiz Fusion. For organization, I like to keep my Pidgin windows all in one place. I'm likely to miss them if they popup behind my Firefox, after all. Usually this means I notice that I have an IM and then hunt around for the window to move it to the proper workspace. No more!

You need to have compizconfig-settings-manager installed. Open it up and go to the Window Management section. In there, enable the Place Windows plugin. Go to the Fixed Window Placement tab. See the "Windows with fixed viewport" part? Click the New button under there. On the popup, click the + button. The type of match should be Window Class. Now hit the Grab button and click on a window for that application. In this case, I chose Pidgin. Hit Add to confirm it. Now you're back to the first popup. Here's perhaps the trickiest part, figuring out which viewport. I'm using the Cube, so for the Y direction, all viewports are number 0. The first viewport I see when I load up is number 0 for the X direction. The cube face to the right of that is number 1. The next is number 2. Et cetera. Choose your settings, and close that popup. Now any new window for that application should automatically open in the proper viewport, yay!

If you're using the Desktop Wall, I believe you can assume 0,0 for the default viewport. The viewport below that should be X0 Y-1 (and above it would be X0 Y1), I think, but feel free to correct me in the comments if I'm wrong on that.

I just used Pidgin as an example for this. Another good use I see for this is making your windows auto-arrange on applications you have set to automatically start.


jblackhall said...

This could actually be really useful. I never really considered it. Thanks a lot for posting.

wolfger said...

The easier solution is to run KDE :-)

Right-click on the title bar of the app, Advanced->Application Settings->Desktop check the box, select "force" and choose a desktop. KDE awesomeness.

(I think those are the exact steps... I'm at work on an XP box at the moment)

Lynoure said...

Yes, I have loved this feature on KDE for years now. Together with kArm it makes it very easy to separate work from play.