It's always fun when the future sneaks up on you, and in the last few months that's exactly what's happened in the land of X. Hackers at Novell crawled into a deep, dark basement and spent months hacking away in secret before emerging in January, eyes blinking from the light, with a still experimental but surprisingly usable OpenGL-based X server called Xgl.
Xgl on its own isn't exactly new -- work started around 2004, and I even mentioned it along with other upcoming technologies in issue 98, but thanks to Novell's most recent round of work, it's solid enough to use on a daily basis if you don't mind a little instability. It uses OpenGL to do all of its drawing, automatically giving it high performance for actions like compositing on OpenGL hardware. The only catch is that, for now at least, the only mature way to get accelerated OpenGL on Linux is using X itself, so for now Xgl runs on top of a standard Xorg server.
Along with Xgl, Novell has built Compiz, a combined window and compositing manager that puts Xgl's high-speed window compositing to great use. OpenGL-accelerated window compositing is part of what makes Mac OS X so impressive to watch, so there are a lot of OS X-style effects on offer.
Shininess
The effects provided by Xgl and Compiz range from quite simple to rather crazy. There are some subtle touches, like drop shadows on windows, and more obvious effects like windows and menus that fade in or out when opened or closed. Windows also jump down into the window bar when minimised, and stretch and wobble when dragged or resized.
The most impressive of the totally frivolous effects would have to be the desktop switching: it spins your desktop around on the sides of a 3D cube, which is damned impressive to watch. By holding down Ctrl and Alt and clicking and dragging on the desktop with the left mouse button, you can even rotate the cube manually. Windows continue to update as you rotate around, so if you really want to wow any passing Windows users, you can open up a video file and keep watching it while you switch between desktops.
While there's certainly a lot of pointless eyecandy, some of the effects do come in handy. The Alt-Tab window switcher in Compiz darkens the whole desktop a little before displaying each of your windows in minimised form along the centre of the screen. An alternative is a rip-off of Mac OS X's Exposé feature -- hit F12 and your windows are temporarily shrunk and re-arranged so that none of them overlap, letting you easily see every window on your desktop. Clicking on a window returns all the windows to their original locations and sizes, with your selected window brought to the front. Windows continue to update live in these modes as well, so any running videos will happily keep playing while you go sorting through your windows.
Xgl today
If all of this fancy-pants eyecandy sounds like something you'd want on your desktop, there's a way to get it all running without having to build any code or do anything else too crazy. In fact, if you just want to have a quick play, there's a live CD built by the Kororaa project (http://getkororaa.com/) that can get Xgl up and running for you with no work required. Deploying it on your usual desktop is a little more tricky, but it's really not that hard with the right setup. I'm using Xgl right now, and there's no reason you can't give it a go yourself.
The first step is to install Ubuntu 6.06, codenamed Dapper Drake. Dapper is now due for release in June after a two month delay, but even in pre-release form it has been quite polished and stable for me. The easiest way to do this is to grab the latest pre-release CD, or "flight" -- Flight 6 was the latest at time of writing.
There's a lot of nice new stuff in Dapper, but most of it will have to wait for another day; today is just for Xgl. Once you have Dapper installed, make sure you have working accelerated OpenGL rendering. For NVIDIA cards, you can install the drivers with a couple of commands:
sudo apt-get install nvidia-glx linux-restricted-modules-386
sudo nvidia-glx-config enable