Placing Evolution windows to specific viewports with Compiz

Compiz has lots of nifty plug-ins and one of them is called Place. What it does essentially it takes a window and puts it on a specific desktop you tell it to.

The tricky part is to write rules to select windows. Evolution proved to be quite a pain to handle. I usually use 6 virtual desktops, or viewports in Compiz parlance. I have two rows of them, each has 3 virtual desktops. I’m used to having an e-mail client running in viewport 3, row 1 (X3:Y1) web-browser and console in viewport 1 (X1:Y1).

Well, initially my idea was to  grab a Window Title for Evolution’s Compose Message window and have it explicitly excluded in the rules. That kind of approach worked just fine on my office workstation where I use Thunderbird, but with Evolution this sort of rule:

title=Evolution & !title=”Compose Message”

Just didn’t work. What happened was either Compose Message window would be still forcibly placed to viewport 3, or, totally weird, main Evolution window would be transferred to active viewport and Compose Message window would take place of main Evolutoin window defined by Place plugin rules (in my case viewport 3, X3:Y1).

But as I said a little earlier, I keep my Chromium window in viewport 1 and when I click an “e-mail to” link I’d love to see Compose Message window in viewport 1, or in other words I want it to follow the viewport I’m working in. Well, that logic expressed in a rule above proved to be a total failure. I tried literally all the options for matching rules: window class, title, role, etc. — none of them worked. I’ve actually almost given up on this idea to take control of Evolution’s windows and left the rules as they were the last time I messed around with Place settings.

Eventually, what I ended up with, though, and it comes as a surprise to me as well, was a simple:


Which was created sort of accidentally, a leftover of the code from the last time I attempted to figure out the matching rules for Evolution, but it turned out to be exactly what I needed.

So, if you need to forcibly place Evolution on its launch to any viewport, just use this rule to match the Evolution main window. That’s it. Compose Message will follow your viewport.

If you feel a little uncomfortable with Compiz’s matching rules syntax, don’t worry I felt it was a little unusual as well! Here’s a nice post, though, that breaks down the most important aspects of the window matching deal:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s