Requirements

Installation

Initial configuration

While the appearance of the windows and their contents is a function of GTK+ and Qt, the frames around the windows are controlled by the Window Decoration plugin. To use it make sure you have a window decorator installed. Depending on what packages you have downloaded you can choose among several window decorators. The most common ones are Emerald, kde-window-decorator, and gtk-window-decorator. The emerald decorator has the advantage that it fits better to Compiz's screen handling and offers transparency effects. To set your default window decorator type the following command string in the "Window Decoration" plugin's settings under the field "Command".

Ensure that the "Window decorator" plugin is enabled in CCSM's "effects" tab, the "command" field is filled in to start a decorator.

To set emerald as your default window decorator type:

$ emerald --replace

To set the kde-window-decorator as an alternative to Emerald type:

$ kde4-window-decorator --replace

To set the compiz-decorator-gtk as an alternative to Emerald type:

$ gtk-window-decorator --replace

Note: Activate important plugins: there is high possibility that you will want to activate a few plugins that provide basic window manager behavior or else you will have no ability to drag, scale or close any windows as soon as Compiz is activated. Among those plugins are "Window Decoration" under "Effects" and "Move Window" & "Resize Window" under "Window Management". These can be enabled with ccsm.

Starting Compiz Fusion

Manually (with "fusion-icon")

Right click on the icon in the panel and go to 'select window manager'. Choose "Compiz" if it isn't selected already, and you should be set.

If this fails you can start Compiz Fusion by using the following additional command to replace your default window decorator with Compiz's window decorator (Emerald):

$ emerald --replace

Again, note: If you want to use Compiz window decorations make sure you have the "Window Decoration" plugin marked in the Compiz settings through CCSM.

Manually (without "fusion-icon")

Launch Compiz with the following command (which replaces your current window manager):

$ compiz --replace ccp &

A quick overview over common Compiz command-line options:

--indirect-rendering: use indirect-rendering (AIGLX)

--loose-binding: can help performance issues (NVIDIA?)

--replace: replace current window-manager

--keep-window-hints: keep the gnome window manager gconf-settings for available viewports

--sm-disable: disable session-management

ccp: the "ccp" command loads the last configured settings from CCSM (CompizConfig Settings Manager) otherwise Compiz will load with no settings and you won't be able to do anything with your windows like dragging, maximizing/minimizing, or moving.

KDE4

Note: The first and last methods will load Compiz Fusion as the default window manager instead of KWin. This is faster than loading Compiz with 'fusion-icon' because it avoids loading two window managers at startup. This also prevents that annoying black screen flicker you might see using other methods (when KWin switches to Compiz on KDE's desktop loading screens). The downside is that if Compiz crashes, it may be more difficult to recover your desktop.

Note: If compiz.desktop already exists, you may have to add --replace and/or ccp to the Exec variable. Without --replace, Compiz won't load since it will detect another window manager already loaded. Without ccp, Compiz will not load any of the settings and plugins that you have enabled through CompizConfig Settings Manager (ccsm) and you won't be able to manipulate any of your windows.

If you want to use the optional Fusion Icon application, launch fusion-icon. If you log out normally with Fusion Icon running, KDE should restore your session and launch it the next time you log in, if you have the following enabled (also available in System Settings > Startup and Shutdown > Session Management > Restore previous session):

~/.kde4/share/config/ksmserverrc

[General]
[...]
loginMode=restorePreviousLogout
[...]

Export KDEWM without "fusion-icon" (preferred)

As root you must create a short script by doing the following in your terminal. This will allow you to load Compiz with the switches because doing it directly via $ export KDEWM="compiz --replace ccp --sm-disable" doesn't seem to work:

$ echo "compiz --replace ccp --sm-disable &" > /usr/bin/compiz-fusion

Note: If this line doesn't work, make sure the fusion-iconAUR package is installed and then use this line instead:

$ echo "fusion-icon &" > /usr/bin/compiz-fusion

Be sure to complete the whole method before trying this substitute.

Ensure that /usr/bin/compiz-fusion has executable (+x) permissions.

$ chmod +x /usr/bin/compiz-fusion

Choose one of the following:

1) For your user only:

~/.kde4/env/compiz.sh

KDEWM="compiz-fusion"

2) System-wide:

/etc/kde/env/compiz.sh

KDEWM="compiz-fusion"

Note:

If that still doesn't work, yet another alternate way to accomplish the above method is to include the line:

$ export KDEWM="compiz-fusion"

in your user's ~/.bashrc file.

If you optionally use the /usr/local/bin directory it may not work. In that case you should export the script including the whole path:

$ export KDEWM="/usr/local/bin/compiz-fusion"

GNOME

If you have installed GNOME3 with gnome-shell, either enable forced Fallback mode (System Info > Graphics) or simply uninstall gnome-shell.

Note: Fallback mode is not necessary if you choose the Compiz/Cairo Dock session method below.

The gnome-session-compizAUR can be used to add an additional menu entry in the GNOME session login dialog. This method does not require foced fallback mode and/or modifications to sensitive system files/settings. Also, you can switch between GNOME Shell and Compiz/Cairo Dock between sessions. If you can't get it working, you can always go back to your original GNOME session.

For this method to work, Compiz and Cairo Dock (Taskbar/Panel) may have to be configured initially for fresh accounts, from another working session (CCSM in GNOME Shell should work fine).

This method completely replaces the GNOME's window manager and panel (they are not launched at all, rather than being replaced or killed later). So, before actually switching to this alternate session, you may want to configure corresponding/alternate features of the original panel application in Cairo Dock:

Remap Application Menu key-bindings to ALT+F1 and ALT+F2, for convenience.

Add Clock, WiFi, NetSpeed icons to the dock as applicable.

Add Log-out icon:

Set the command for logout to gnome-session-quit --logout

Set the command for shutdown to gnome-session-quit --power-off

Add the Notification Area Old (systray) icon to Cairo Dock.

Autostart (without "fusion-icon") (preferred method)

This Method makes use of the Desktop Entry Specification to specify a Compiz Desktop Entry and of the GConf default windowmanager setting. Thanks to the Desktop Entry you should be able to select Compiz as a windowmanager out of GDM.

1) If the following file doesn't already exist (it should), create it

/usr/share/applications/compiz.desktop

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Compiz
Exec=/usr/bin/compiz ccp #Make sure ccp is included so that Compiz loads your previous settings.
NoDisplay=true
# name of loadable control center module
X-GNOME-WMSettingsModule=compiz
# autostart phase
##-> the following line cause gnome-session warning and slow startup, so try not to enable this
# X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager
# name we put on the WM spec check window
X-GNOME-WMName=Compiz
# back compat only
X-GnomeWMSettingsLibrary=compiz

Note: If compiz.desktop already exists, you must make sure that the "ccp" is included in the Exec variable. Having "ccp" included simply tells Compiz to load your previous settings, otherwise you won't have any functionality.

If the above doesn't work (in most cases it does), for example if you notice some issues with windows refreshing or low performance, try:

as noted in the forum. You can also add the extra parameters as described above if needed.

2) Set some GConf parameters using the gconftool-2 command in a terminal window or do it visually with Configuration Editor (gconf-editor). The following outlines using the command line method, but you can also see which keys to change using gconf-editor:

Note: Since those parameters apply to a given user, you must logout from the root account and log in as that other user before proceeding with the next steps. GConf will fail, if called from a root account.

Autostart (with "fusion-icon")

To start Compiz Fusion automatically when starting a session go to System > Preferences > Startup Applications. In the Startup Programs tab, click the Add button.

You will now see the Add Startup Program dialogue. Fill it in as follows.

Name:

Compiz Fusion

Command:

fusion-icon

Comment: (Put anything you like or leave blank.)

Note: You can also use compiz --replace ccp instead of the Fusion Icon to load Compiz.
The ccp value will tell compiz to load your previous Compiz settings as configured with CompizConfig Settings Manager (ccsm.

When you're done hit the Add button. You should now see your startup program in the list in the Startup Programs tab. It must be checked to be enabled. You can uncheck it to disable Compiz on startup and switch back to Metacity.

You may also need to use the gconftool-2 command in a terminal window to set the following parameter, otherwise Fusion Icon might not load the windows decorator.

Note: This method will be slower due to the fact that Gnome will first load the default window manager (Metacity), then will launch Fusion Icon which will load the Compiz window manager to replace Metacity. Essentially, it will take the amount of time that it takes to load two window manangers to get Compiz loaded. The first method is preferred and eliminates this issue.

Note: You can also use compiz --replace ccp instead of the Fusion Icon to load Compiz. The ccp value will tell compiz to load your previous Compiz settings as configured with CompizConfig Settings Manager (ccsm).

Method 2

Edit the file ~/.config/xfce4-session/xfce4-session.rc (settings in this file is used in preference).

Or to make the change for all Xfce users:

/etc/xdg/xfce4-session/xfce4-session.rc

[...]
[Failsafe Session]
Client0_Command=fusion-icon

This will cause xfce to load Compiz instead of Xfwm when the user has no existing sessions.

To prevent the default session from being overwritten you may also add:

However chances are you will need additional apps (e.g a panel) for optimal usability:

~/.xinitrc

tint2 &
cairo-dock &
exec fusion-icon

Note: Add a terminal-emulator to this autostart list while starting for the first time to help configure Compiz.

Add a root menu

To add a root menu similar to that in Openbox, Fluxbox, Blackbox etc. you must install the package compiz-deskmenuAUR.
Upon a restart of Compiz Fusion, you should be able to middle click on your desktop to launch the menu.

If it does not automatically work, enter the CompizConfig Settings Manager, and in Commands tab, within the General Settings menu, ensure that there is a command to launch Compiz-Deskmenu, and the appropriate key binding is set to Ctrl+Space.

If it still does not work, enter the Viewport Switcher menu, and change "Plugin for initiate action" to 'commands', and "Action name for initiate" to run_command0_key.

Allow users to shutdown/reboot

Refer to this wiki page. If using "The Modern way" of policykit you can add the command to CCSM > General > Commands and assign a short-cut key to it or alternatively you can use a launcher application.

Miscellaneous

Configuration

Using gtk-window-decorator

In order to use gtk-window-decorator, install the package compiz-decorator-gtkAUR and select "GTK Window Decorator" instead of "Emerald" as your window decorator in Fusion Icon or whatever other program you are using to configure compiz.

gconf: additional Compiz configurations

To achieve more satisfying results from Compiz, you can tweak its config with gconf-editor:

$ gconf-editor

Note that now compiz-core isn't built with gconf support; It is now built with gconf support through compiz-decorator-gtk. So, you need to install it if you want to use gconf-editor to edit your Compiz configuration.
The Compiz gconf configuration is located in in the key apps > compiz > general > allscreens > options.

"Active plugins" is where you specify the plugins you would like to use. Simply edit the key and add a value(refer to the key apps > compiz > plugins to see possible values). Plugins I’ve found useful are screenshot, png, fade, and minimize. Please do not remove those enabled by default.

ATI R600/R700 notes

While using Fusion Icon you shouldn't experience any problems because it takes care of everything for you, but if you are using one of the autostart methods that do not involve Fusion Icon you will run into trouble. For example when using the Xfce autostart method without fusion icon you must edit ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml per the instructions above. However, if you follow the directions above explicity you will find that Compiz does not load. You must instead make your xfce4-session.xml file look like this

This example targeted Xfce specifically, but it can be adapted to any desktop environment. It's just a matter of figuring out how to add it to the proper config file. The key thing is the required command which if typed on a command line would look like this

Note: Compiz basic plugins are not enabled by default. You should enable "Move Window", "Resize Window", and "Window decoration" plugins in settings manager from Fusion Icon to have a usable window manager.

Compiz starts, but gtk-window-decorator does not

It is a configuration problem for gconf and gconfd. You may try removing ~/.gconf/. This will erase your Compiz settings, so be sure to reconfigure.
Finally as user:

You may also try adding Option "AddARGBGLXVisuals" "True" and Option "DisableGLXRootClipping" "True" to your "Screen" section, if you are using the NVIDIA binary driver. If you used any other Options elsewhere in /etc/X11/xorg.conf.d/ to get Compiz working and still have no luck, try commenting them out and using only the aformentioned ARGBGLXVisuals and GLXRootClipping Options.

the problem is with the permission on ~/.config/compiz/. To fix it, use:

# chown -R <username> /home/<username>/.config/compiz/

Choppy animations, even though everything configured correctly

If everything is configured correctly but you still have poor performance on some effects, try disabling CCSM > General Options > Display Settings > Detect Refresh Rate and instead choose a value manually. Tested on both NVIDIA and Intel chips. Can work wonders.

Alternatively, if your chip is NVIDIA and you are experiencing an inadequate refresh rate with "Detect Refresh Rate" enabled in Compiz, it's likely due to an option called DynamicTwinView being enabled by default which plays a factor in accurately reporting the maximum refresh rate that your card and display support. You can disable DynamicTwinView by adding the following line to the "Device" or "Screen" section of your /etc/X11/xorg.conf.d/*.conf, and then restarting your computer:

Option "DynamicTwinView" "False"

Doing so will allow XrandR to accurately report the refresh rate to anything that detects it, including Compiz. You should be able to leave "Detect Refresh Rate" enabled and get excellent performance. Once again, this only applies to NVIDIA chips.

Fix GNOME screenshot

To re-enable gnome-screenshot (the default behavior caused by hitting PrtScn) simply go to Settings Manager>Commands and map 'gnome-screenshot' to the 'PrtScn' key. This is advantageous because you can also use the Compiz Fusion 'Screenshot' plugin at the same time since the action that enables it is Super+Button1 thereby giving you two methods to do a screen capture (one of which gives a full screen capture in a single keystroke).

Get GNOME workspace switcher work with Compiz Fusion

In older versions of Compiz, the Gnome Workspace Switcher applet would actually work with Compiz Fusion (i.e. rotate cube/move plane etc.), but recent versions seem not to. This is due to a new feature introduced in Compiz, which allows real seperate workspaces. For example, if you have a desktop plane with four planes, and have four desktops enabled in Gnome, it sums up to a total of 16 different workspaces. Currently, there is no animation associated with "real" workspace changing. To get the Workspace Switcher work, set the following options in GConf:

Screen flicks with NVIDIA card

To fix it, create the following:

/etc/modprobe.d/nvidia.conf

options nvidia NVreg_RegistryDwords="PerfLevelSrc=0x2222"

Setting the window manager back to Metacity after uninstall

Removing Compiz with pacman does not set your window manager back to metacity. This can result in no window borders being drawn, an inability to minimize, and an inability to change the focus. To change it back, run gconf-editor. Use this to set the value of the key /desktop/gnome/session/required_components/window_manager from "compiz" to "metacity". Log out and back in for changes to take effect.