Compiz (简体中文)

From ArchWiki
Revision as of 15:33, 4 December 2012 by (Talk | contribs) (wikify some external links, use https for

Jump to: navigation, search


请通过更新这篇文章和改正错误帮助改善 wiki。

Template:Article summary start Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end

Compiz 是一个 合成窗口管理器。它提供了自己的窗口管理器,所以它不能和其他的窗口管理器(如Openbox, Fluxbox, Enlightenment) 同时使用。想继续使用当前的窗口管理器以及想添加更多效果的用户可以尝试 Xcompmgr



Users of major DEs cam make good use of compiz-manager, performing brief requirements checking and switching to fallback WM in case of errors. Discovering setup and hardware issues can also be done with compiz-checkAUR script (available in AUR).


所有官方软件仓库中的包都可以用 pacman 安装 compiz-fusion 软件包组。

如果你不想安装所有的软件,还有软件包组 compiz-fusion-gtkcompiz-fusion-kde 分别适合于 GNOME or KDE

Users who wish to select the packages individually may start with compiz-core and one of decorators.

Note: Lack of configured window decorator can render your X workspace slightly unusable.

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". 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

There is high possibility that you will also want to activate a few plugins. Among those are "Window Decoration" under Effects and "Move Window" & "Resize Window" under Window Management. Ccsm may be used to achieve this. Launch CompizConfig Settings Manager:

$ ccsm

Additional software


  • Emerald — Compiz's own window decorator with few dependencies. (Note: Works but is buggy and no longer maintained) || emerald


启动Compiz Fusion

手动 (使用 "fusion-icon")

启动Compiz Fusion托盘图标:

$ fusion-icon
注意: 如果失败,可以尝试用dbus-launch启动
$ dbus-launch "fusion-icon"

右键点击面板上的图标,选择'select window manager'->'Compiz',如果它尚未被选的话请选择它。

如果失败了,可以用以下命令 to replace your default window decorator with Compiz's window decorator (Emerald):

 $ emerald --replace
注意: If you want to use compiz window decorations make sure you have the "Window Decoration" plugin marked in the compiz settings through ccsm.



$ 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.


自动运行 (使用"fusion-icon")


$ ln -s /usr/bin/fusion-icon ~/.kde/Autostart/fusion-icon


Template:Box Note

自动运行 (不使用"fusion-icon")

方法 1 - 自动启动链接
  • 在KDE的autostart目录里加入一个desktop entry使得Compiz Fusion在登录时启动。用以下内容创建文件~/.kde/Autostart/compiz.desktop
[Desktop Entry]
Exec=/usr/bin/compiz ccp --replace
# name of loadable control center module
# autostart phase
# name we put on the WM spec check window
# back compat only
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.
Note: This method can also be slower due to the fact that KDE will first load the default window manager (KWin), then will launch fusion-icon which will load the Compiz window manager to replace KWin. Essentially, it will take the amount of time that it takes to load two window managers to get Compiz loaded. The next method eliminates this problem.
  • 如果你想要使用 compiz.desktop 应用程序则运行fusion-icon。如果设置正确,当你在fusion-icon运行过程种正常注销,下次登录时KDE会恢复你的会话并启动fusion-icon。如果不成功,请确认~/.kde/share/config/ksmserverrc中有以下内容:
Note: This is a KDE specific setting that will allow you to restore other apps next time you log in, not just fusion-icon.
方法 2 - 导出KDEWM (更好的方法)
注意: 使用本方法将使得启动时加载Compiz-Fusion而不是KWIN为缺省窗口管理器,这种方式比在~/.kde/Autostart/中加载Compiz-Fusion(方法1)要快些,因为它无须先加载KDE的缺省WM (kwin)。这种方法也避免了其它方式下KDE桌面加载过程中kwin切换到Compiz时的恼人的黑屏闪烁。

在终端里以root身份用以下命令创建一个小脚本。它使得你可以带参数加载compiz,这是因为直接用export KDEWM="compiz --replace ccp --sm-disable"无法正常工作。

$ echo "compiz --replace ccp --sm-disable &" > /usr/bin/compiz-fusion
Note: If this line doesn't work, make sure the "fusion-icon" 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 a+x /usr/bin/compiz-fusion

Choose one of the following:

1) Compiz for your user only --> Edit the file ~/.kde4/env/ and add the following line so KDE will load compiz (via the script you just created) instead of loading KWin.
2) Compiz system wide --> Edit the file /etc/kde/env/ and add the following line so KDE will load compiz (via the script you just created) instead of loading KWin.

Template:Box Note Template:Box Note Template:Box Note

Method 3 - Use KDE 4 System Settings

Go to System Settings --> Default Applications --> Window Manager --> Use a different window manager

If you need to run compiz with custom options select "Compiz custom" (when you run fusion-icon from a terminal you can see the command line with which compiz was started). Create a file called "compiz-kde-launcher" in your /usr/bin directory. Then make the file executable: "chmod +x /usr/bin/compiz-kde-launcher". Here is an example for compiz-kde-launcher:

 compiz --replace ccp &


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.

Alternate Session for GNOME (Preferred Method for Experienced Compiz/Dock Users)

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 worked fine for me).

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:

  • Add Application Menu icon to Cairo-Dock and remember its key-bindings.
  • 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 containing the following:

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

Template:Box Note

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:

Exec=/usr/bin/compiz ccp --indirect-rendering


Exec=/usr/bin/compiz --replace --sm-disable --ignore-desktop-hints ccp --indirect-rendering

Instead of

Exec=/usr/bin/compiz ccp

Some Users noticed a "lag" of 4-10 seconds when loging in from a login manager. The solution is to change the command to:

Exec=bash -c 'compiz ccp decoration --sm-client-id $DESKTOP_AUTOSTART_ID'

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.
gconftool-2 --set -t string /desktop/gnome/session/required_components/windowmanager compiz

The following are optional and in most cases not necessary (the respective keys are deprecated since GNOME 2.12). But iny any case, if the above didn't succeed the next two statements are still valid and should be tried.

gconftool-2 --set -t string /desktop/gnome/applications/window_manager/current /usr/bin/compiz
gconftool-2 --set -t string /desktop/gnome/applications/window_manager/default /usr/bin/compiz

Autostart (without "fusion-icon") (With gnome3 fallback mode session)

Edit file /usr/share/gnome-session/sessions/gnome-fallback.session:

Replace your windows manager (gnome-shell,metacity...) with compiz in RequiredComponents line.

Change DefaultProvider-windowmanager line to DefaultProvider-windowmanager=compiz

Here is part of my gnome-fallback.session:


Template:Box Note

Autostart (without "fusion-icon", Gnome prior to 2.24)

This is a way that works if you use GDM (and I'd assume KDM too).

Make a file called /usr/local/bin/compiz-start-boot with the contents:

export WINDOW_MANAGER="compiz ccp"
exec gnome-session

and make it executable (chmod +x /usr/local/bin/compiz-start-boot). Next create the file /etc/X11/sessions/Compiz.desktop containing the following:

[Desktop Entry]
Name=Compiz on GNOME

Select Compiz on Gnome as your session and you're good to go.

自动运行 (使用"compiz-fusion")

要启动会话时自动运行Compiz fusion ,可将

  "Compiz Fusion" (Name:)

   "fusion-icon" (Command:)


  [System] -> [Preferences] -> [Sessions] -> [Startup Programs]
Note: You can also use "compiz --replace ccp" instead of "fusion-icon" to load compiz but there will be no fusion-icon. 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.

gconftool-2 --type bool --set /apps/metacity/general/compositing_manager false
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.


Xfce 自动运行 (不使用 "compiz-fusion")

This method will start Compiz directly through the XFCE session manager without loading Xfwm.

Please note the change to xml config files in XFCE newer than 4.2

To install the session manager, install xfce4-session.

Now we have to configure the default/failsafe session of XFCE.

Edit the ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml or (to make the change for all XFCE users) /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml:

Replace the xfwm startup command,

 <property name="Client0_Command" type="array">
   <value type="string" value="xfwm4"/>

with the following:

 <property name="Client0_Command" type="array">
   <value type="string" value="compiz"/>
   <value type="string" value="ccp"/>
Note: the ccp value will tell compiz to load your previous Compiz settings as configured with CompizConfig Settings Manager (ccsm).

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

 <property name="general" type="empty">
   <property name="SaveOnExit" type="bool" value="false"/>

To remove the existing sessions, run:

$ rm -r ~/.cache/sessions

Xfce 自动运行 (使用 "compiz-fusion")



启动"Autostarted Applications"


  (Name:) Compiz Fusion

  (Command:) fusion-icon
Note: You can also use "compiz --replace ccp" instead of "fusion-icon" to load compiz but there will be no fusion-icon. The ccp value will tell compiz to load your previous Compiz settings as configured with CompizConfig Settings Manager (ccsm).
Note: This method is the least preferred since it loads both window managers. All the other XFCE methods only load Compiz without loading Xfwm.


$ nano ~/.conf/xfce4-session/xfce4-session.rc


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


[Failsafe Session]


这将使得xfce在用户没有任何sessions的情况下加载Compiz Fusion而不是xfwm4。




rm -R ~/.cache/sessions
Method 3:

Check if this file exists:


If not do:

cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml

and edit ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml

or (to make the changes for all xfce4 users) /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml:

Edit Client0_Command that it look like this:

<property name="Client0_Command" type="array">
    <value type="string" value="fusion-icon"/>
    <value type="string" value="--force-compiz"/>

if --force-compiz dosen't work use compiz --replace --sm-disable --ignore-desktop-hints ccp instead.

Add the SaveOnExit property if missing and set it to false:

<property name="general" type="empty">
   <property name="FailsafeSessionName" type="string" value="Failsafe"/>
   <property name="SessionName" type="string" value="Default"/>
   <property name="SaveOnExit" type="bool" value="false"/>

finally remove old xfce4 sessions:

rm -r ~/.cache/sessions

Now xfce4 will load compiz instead of Xfwm.

As a Standalone Window Manager

The package compiz-core by itself is sufficient to start using compiz-fusion. However ccsm and emerald (or another window-decorator) are additional highly recommended packages. You may install fusion-icon, compiz-fusion-plugins-main, compiz-fusion-plugins-extra or any other package later on at any time.

To autostart compiz-fusion configure .xinitrc to launch compiz as:

exec compiz ccp

You can also add other command-line options to your .xinitrc

Or if using fusion-icon, configure .xinitrc as

exec fusion-icon

However chances are you will need additional apps (e.g a panel) for optimal usability. So to autostart such apps simply add them to your .xinitrc as:

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.

An alternative method, utilizing a simple script entitled
# add more apps here if necessary or start another panel, tray like pypanel, bmpanel, stalonetray

If this script dosn't work for you, or you get issues with dbus utilize this script:
cd /home/<yourusername>
eval `dbus-launch --sh-syntax --exit-with-session`
/usr/bin/X :0.0 -br -audit 0 -nolisten tcp vt7 &
export DISPLAY=:0.0
sleep 1
compiz-manager decoration move resize > /tmp/compiz.log 2>&1 &
# add more apps here if necessary or start another panel, tray like pypanel, bmpanel, stalonetray

Make it executable

chmod +x

And add it to .xinitrc, like this:

exec /path/to/file/

Feel free to use a different panel, tray, or start a whole bunch of applications with your session. See this forum thread for more info.

Note: Using a separate script instead of running everything from xinitrc is the only way to let all launching applications use ConsoleKit: see this article.

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 Control+Space.

If it still does not work, enter the Viewport Switcher menu, and change "Plugin for initiate action" to core (NOTE: for versions 0.8.2+ it's 'commands' instead of 'core'), and "Action name for initiate" to run_command0_key.

An alternative is to use mygtkmenu, also in AUR.

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.



You must do this so your windows function like you expect them to!

Using compiz-manager

In order to use compiz-manager, you need to install it from community:

pacman -S compiz-manager

Compiz-manager, that is now installed in /usr/bin/compiz-manager, is a simple wrapper for Compiz and ALL of its options. For example, you can run


and see what the console returns for more info. You can use it in all the scripts that start Compiz. Very simple!

Using gtk-window-decorator

In order to use gtk-window-decorator, install the package compiz-decorator-gtk 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

<property name="Client0_Command" type="array">
 <value type="string" value="LIBGL_ALWAYS_INDIRECT=1"/>
 <value type="string" value="compiz"/>
 <value type="string" value="--sm-disable"/>
 <value type="string" value="--ignore-desktop-hints"/>
 <value type="string" value="ccp"/>
 <value type="string" value="--indirect-rendering"/>

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

LIBGL_ALWAYS_INDIRECT=1 compiz --sm-disable --ignore-desktop-hints ccp --indirect-rendering

This is how Xfce's session manager interprets the above XML code. Notice that you do not need --replace because you are not first loading xfwm and then compiz.

Tips and tricks


If you are using KDE, GNOME or XFCE and something is not right, for example you don’t see borders for your window, you can switch back to default DE window manager with this command:

wm_name --replace

with kwin, metacity or xfwm4 instead of wm_name.

Keyboard Shortcuts

Default plugin keyboard shortcuts (plugins have to be activated!)

A more detailed list can be found under CommonKeyboardShortcuts in the Compiz wiki or you can always just look at your plugin's configuration (ccsm).


  • 请确认没有设置$XLIB_SKIP_ARGB_VISUALS环境变量


如果在KDE中Compiz Fusion出了问题,例如窗口边框消失,可以通过下面的命令切换回KWIN:

 kwin --replace


如果在GNOME中Compiz Fusion出了问题,例如窗口边框消失,可以通过下面的命令切换回metacity:

metacity --replace

运行Compiz Fusion时提示:缺少GLX_EXT_texture_from_pixmaps(ATI显卡)


如果在ATI显卡上运行Compiz Fusion时提示:


这是因为Compiz Fusion的二进制文件是针对Mesa的OpenGL库编译的。重新安装libgl-dri(这需要先临时卸载fglrx)来获得Mesa的OpenGL库。然后把库文件拷贝到一个目录保存起来(ATI驱动会覆


mkdir /lib/mesa
cp /usr/lib/ /lib/mesa

然后重新安装fglrx包,然后使用下面的命令来启动Compiz Fusion:

LD_PRELOAD=/lib/mesa/ compiz --replace &



 LIBGL_ALWAYS_INDIRECT=1 compiz --replace ccp &

(在以下显卡中测试成功: ATI Technologies Inc Radeon R250 [Mobility FireGL 9000] (rev 02))

在2007-10-17,Compiz-Fusion Wiki显示: "如果你使用Intel GMA显卡的AIGLX,你需要在启动Compiz Fusion时附加参数:




# gtk-update-icon-cache -f /usr/share/icons/hicolor


# pacman -S hicolor-icon-theme



如果你已经安装了compiz-decorator-gtk: 检查一下GConf schema有无正确安装:

 gconftool-2 -R /apps/compiz/plugins | grep plugins

确认所有插件已列出(不仅仅是fade!)。如果没有,请手动安装compiz schema(以普通用户身份而不是root!!!):

 gconftool-2 --install-schema-file=/usr/share/gconf/schemas/compiz-decorator-gtk.schemas


这是gconf和gconfd的配置问题。我使用的是KDE,通过删除home下的.gonf解决了此问题。如果你使用Gnome, you should enter your ".gconf" directory and remove all compiz keys. You'll loose your Compiz settings tough! Finally exec as user:

 gconftool-2 --install-schema-file=/usr/share/gconf/schemas/compiz-decorator-gtk.schemas


如果唤醒时机器白屏,只剩下鼠标可以动,可以尝试禁止掉sync to vblank:

gconftool -s /apps/compiz/general/screen0/options/sync_to_vblank-t boolean false



[andy@andylaptop ~]$ fusion-icon
 * Detected Session: gnome
 * Searching for installed applications...
Traceback (most recent call last):
  File "/usr/bin/fusion-icon", line 57, in <module>
    from FusionIcon.interface import choose_interface
  File "/usr/lib/python2.5/site-packages/FusionIcon/", line 23, in <module>
    import start
  File "/usr/lib/python2.5/site-packages/FusionIcon/", line 36, in <module>
  File "/usr/lib/python2.5/site-packages/FusionIcon/", line 362, in check
  File "/usr/lib/python2.5/", line 172, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/andy/.config/compiz'


chown <username> /home/<username>/.config/compiz


如果你在Compiz下无法看到视频回放,可以将视频输出换为OpenGL之类。在VLC中可以在Settings->Video->Output modules的advanced options里找到。


  • Composite -- A Xorg extension required by composite managers
  • Compiz Fusion -- A composite and window manager offering a rich 3D accelerated desktop environment
  • Compiz -- The original composite/window manager from Novell
  • Xcompmgr -- A simple composite manager capable of drop shadows and primitive transparency
  • Beryl -- A composite/window manager forked from Compiz (since merged to become Compiz Fusion)
  • Wikipedia: Compositing Window Managers