Introduction

Many people use Compiz-Fusion in Gnome or KDE, but it is also possible to use it as a standalone window manager like Openbox. It is a very light environment, compared to Gnome or KDE (but still heavier than Openbox). This wiki entry explains how to set up a Compiz standalone session and how to fix some related issues. I assume you already got a standard Ubuntu (Gnome) system available, but it is also possible to setup it from a minimal system.

Installation

Requirements for minimal system

If you have a standard Ubuntu/Gnome system, you don't need to install anything to run Compiz Standalone, so skip to the next section. In a minimal system, you need to install the following packages:

sudo aptitude install xorg xterm compiz gdm jockey-gtk

You'll also need a panel, application launcher, network manager etc, because Compiz alone is only a Window Manager and won't let you do much. There are many options available, and you can see some at the screenshots and issues sections.

I'm using GDM as a login manager, but you can replace it with KDM or XDM. To launch GDM, run:

sudo /etc/init.d/gdm start

Login into a xterm session and run jockey-gtk to install your graphical card driver, which is required by Compiz. After restart, open a xterm session again and run the following command to test it:

compiz --replace ccp

If you see window borders around xterm, then it worked. Now we have to create an option to launch a Compiz session from your login manager.

Add a login manager session

First, we'll create a xsession entry in /usr/share/xsessions/compiz-session.desktop. It will add an option to GDM. It is a .desktop file like those that populate your Gnome menu:

[Desktop Entry]
Encoding=UTF-8
Name=Compiz
Comment=Compiz-Fusion standalone
Exec=/usr/local/bin/compiz-session
Type=Application

As you can see in the Exec entry, this session will execute the launcher /usr/local/bin/compiz-session. Create this file and make it executable:

#!/bin/bash
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
    eval `dbus-launch --sh-syntax --exit-with-session`
fi
compiz --replace ccp & wmpid=$!
sleep 1
if [ -f ~/.compiz-session ]; then
    source ~/.compiz-session &
else
    xterm &
fi
# Wait for WM
wait $wmpid

This launcher starts a DBUS session (required by some applications) and the Compiz WM. After starting it, it will run the ~/.compiz-session file. Create this file, launching your panels, monitors, wallpaper, file manager, etc. All the lines on this file should end with the & character. If the file does not exist, the launcher will start xterm, so you can launch other programs. See the screenshots section for some ideas.

Screenshots

This section don't make much sense, because the looks and functionality when you are using Compiz Standalone depends on what you are using. With Compiz itself you'll only see your wallpaper (if the plugin is enabled). This section will show screenshots of different setups, and how to achieve them. Feel free to contribute with your own shots.

Gnome-panel and Nautilus

gnome-panel and nautilus

With this setup, you'll have the same look as Gnome.

gnome-panel &
nautilus -n &

Tint2 and Gmrun

tint2 and gmrun

Tint2 is a very customizable and lightweight panel you can use in Compiz. It is not available at Ubuntu repositories, but you can use their PPA. Gmrun is just a plain "run dialog", available at the repositories. You can create a shortcut to start gmrun using CCSM.

tint2 &
gmrun &

Gnome-Do

gnome-do, conky and stalonetray

You can also have a panel-less environment, using an application launcher like Gnome-Do. The lack of a notification area and a clock can be fixed with Stalonetray and Conky. You may need to remove both Conky and Stalonetray shadows using CCSM.

gnome-do &
conky &
stalonetray -t &

Issues and workarounds

Ugly applications

When you are using Compiz Standalone, your Gtk+ applications won't use the same theme used in Gnome, but the theme in your ~/.gtkrc-2.0 file. You can use LXAppearance to change your theme, or tweak the file yourself:

gtk-theme-name="Human"
gtk-icon-theme-name="Human"
gtk-font-name="Liberation 8"
gtk-cursor-theme-name="DMZ-Black"
gtk-cursor-theme-size=16

If you prefer, you can still use the Gnome settings if you add to your session launcher the following line:

gnome-settings-daemon &

No wireless/network

You can start NetworkManager if you add this line to your session launcher:

nm-applet --sm-disable &

No wallpaper

The Compiz Wallpaper plugin is disabled by default. Enable it using ccsm.

You can instead use nitrogen, feh, or a file manager that can display a wallpaper. I prefer to use the Compiz plugin, because it can handle different pictures in each workspace.

Other issues

If you have questions or suggestions, please post at this Ubuntu Forums thread: http://ubuntuforums.org/showthread.php?t=1274678

References

http://crunchbanglinux.org/forums/topic/2827/howto-run-compiz-as-a-standalone-window-manager/

CompizStandalone (last edited 2009-09-30 19:28:16 by 189)