Tag Archives: mac

VNC on OS X + Devil's Pie = seamless desktop

I've been doing iPhone development lately using a mac mini. When we first started looking at developing for the iPhone it seemed like overkill to go out and buy multiple macbooks or one macbook to share between developers so instead we got a mac mini to share using Vine VNC.

For reference we are able to share the mac mini by taking advantage of fast user switching for more information see this guide on using Multiple Desktop Sessions on Mac OS X.

The VNC part is pretty easy once you have the multiple desktop sessions working. I've been doing development on a linux box that has two monitors connected so I will open the desktop in one window and all the non-mac stuff in the other. After using the VNC desktop like that for a while I started to get annoyed by the window decorations so I looked to see what I could do to remove them and that is when I ran into Devil's Pie.

Devil's Pie runs as an application in the background and watches for window events that you set up in a configuration file. When it sees the events it can do all kinds of fancy things to the window like remove decorations and set position. It turns out there isn't a lot of documentation on the configuration language but I did find a configuration language reference, a gnome configuration file editor that kind of works depending on what you need it to do, a decent reference, some configuration examples, and best of all an example of how to remove window effects. With all that I was able to cobble together the following configuration file:

(if (contains (window_name) "VNC:") (begin (undecorate) (maximize) (geometry "+1280+0")))

This says to undecorate, maximize, and set the geometry of any window that contains the value "VNC:". The undecorate will strip the title bar and any border from the window, the maximize does what it says to the window, and the geometry in my case puts the window on the right hand screen. I tweaked the background for my account in OS X and the resulting combination of it all looks like this:

(Click the image to see a larger version)

So now I have what feels like an OS X box integrated right into my normal desktop.