HowtosHome > howto documents > eyecandy > X eyecandy (pt.1)

 

X eyecandy (pt.1)

an overview of window managers and eyecandy

Since the XFree86/x.org split, development of X has accelerated significantly into new and exciting areas. Real shadows, translucency and accelerated X using openGL have now arrived. This article will set out what's required to get some serious eye candy happening on your linux desktop. It is not a technical howto. I may expand on some aspects of this page and provide more technical detail at a later stage.

I have split this page into two sections. The first deals with composite extensions for a non-accelerated eye candy. The second deals with Xgl, AIGLX and accelerated eye candy - shadows, wobbly windows, 3D desktop switching, expose-like alt+tab functionality and much much more ... check this out to see what's possible:

non-accelerated eye candy

nvidia is the key

I hate to say it, but if you want fast, stable shadows and translucency, you need an nvidia based card, and the proprietary nvidia drivers. Unfortunately, the "nv" driver that comes with x.org just doesn't cut it ... sorry. I also understand that getting ATI cards to work stably with shadows and translucency is also an issue - I haven't tried an ATI card for a few years, so if I'm wrong on that, let me know. I've also used the onboard intel 865 and 945 graphics chip, which seems to be relatively stable. The 865 seems to lack the speed of the nvidia cards with all the options turned on, however, the 945 chips seems to be pretty good and as you will see below, actually surpasses some lower end nvidia cards on AIGLX.

you'll need x.org >=6.8.0

So now you've gone out and spent a fortune on a new nvidia card, let's get on with the technical stuff. First thing you need to do is get the x.org X server. You need version version 6.8.0 or later - the current version is 7.1. If your distribution doesn't have packages available, then ditch your distro (it must be seriously out of date) - alternatively compile it from source. Now that you've got a working x.org X server, we can move on to configuring it to produce beautiful shadows and translucency.

composite extensions

it's the composite extensions in the x.org X server that lays the foundation for non-accelerated shadows and translucency. So you need to enable these extensions. In order to do this, you need to add the following lines to /etc/X11/xorg.conf:

  • Section "Extensions"
    • Option "Composite" "Enable"
    • Option "RENDER" "Enable"
  • EndSection

This will get the composite extension working, but won't actually have any effect on your desktop yet. The next thing you need to do is turn on some options for the nvidia drivers. My "Device" section looks like this:

  • Section "Device"
    • Identifier "NVIDIA GeForce 5200"
    • Driver "nvidia"
    • VideoRAM 131072
    • Option "AllowGLXWithComposite" "1"
    • Option "RenderAccel" "true"
  • EndSection

This does two things. First, it enables accelerated rendering, which speeds up rendering of shadows and translucency. If you don't have this enabled, shadows and translucency will be slow. nvidia warns that this option is still experimental, however, it has been very stable for me with the latest nvidia drivers. The "AllowGLXWithComposite" option allows glx and composite to run together. Without it, you will lose acceleration on openGL applications - a compromise that I was most unhappy with. This option fixes that. For intel graphics chips, these options won't be effective.

composite managers

Now, you still don't have anything to show for your labours. You've enabled all this stuff, and still no shadows and not a see-through window anywhere. You need something called a composite manager. Now this is where things get interesting. You can choose between a generic one, or one that's built for your particular window manager/DE.

First, the generic one. It's called xcompmgr, and will work with any windows on any desktops. This is the experimental composite manager put out by x.org. Unfortunately, it can be unstable on some setups, and is rudimentary to configure. However, it works well enough, if you don't have a specific composite manager for your DE/window manager.

The second group of composite managers have been written as part of the window managers for certain DE's. There are a number of them which have a composite manager built in. The ones that I know about are metacity, waimea, xfce and kde >= 3.4.0. I haven't used waimea in a long time, and certainly not with a composite manager, so can't comment on how it's composite manager works. I have used xfce, and if you're looking for a light, but relatively complete DE, then this is a very good option. It's composite manager is very quick and stable. It works nicely on non-nvidia hardware, but only supports shadows. There are no configuration options, and no translucency and/or fading.

Finally, kde >= 3.4.0 has introduced a composite manager into kwin. This seems to be a really good implimentation. The first thing you'll need is kde 3.4.0 or greater (the latest version is usually best). If your distro hasn't packaged the latest version, then you could try konstruct. Konstruct is a build script, that'll compile kde from source, but install it in your /home directory, so that it doesn't break your system install of kde. It automagically downloads and builds the latest stable kde from source.

To get non-accelerated shadows and translucency in kde, you'll need to open the control centre, and go to Desktop -> Window Behaviour. The last tab in that section should be "Translucency". There is an option to turn on shadows and translucency. Once you've turned these on, you can go to town with fiddling with options. There's a huge number of things to play with. If, as a result of turning this on, you have performance issues, I would recommend turning off fading, turning off shadows and translucency when moving windows, and don't show window content when resizing windows.

See here for an article on accelerated eyecandy, like Beryl, Compiz, XGL and AIGLX.

You can discuss this howto on the forums.