Difference between revisions of "Compiz (简体中文)"

From ArchWiki
Jump to: navigation, search
(flagged broken section links (interactive))
(Tag: wiki-scripts)
 
(66 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 
[[Category:Eye candy (简体中文)]]
 
[[Category:Eye candy (简体中文)]]
 
[[Category:Stacking WMs (简体中文)]]
 
[[Category:Stacking WMs (简体中文)]]
 +
[[Category:简体中文]]
 +
[[de:Compiz-fusion]]
 
[[el:Compiz]]
 
[[el:Compiz]]
 
[[en:Compiz]]
 
[[en:Compiz]]
 
[[es:Compiz]]
 
[[es:Compiz]]
 +
[[fr:Compiz]]
 
[[it:Compiz]]
 
[[it:Compiz]]
 
[[ja:Compiz]]
 
[[ja:Compiz]]
Line 9: Line 12:
 
[[pt:Compiz]]
 
[[pt:Compiz]]
 
[[ru:Compiz]]
 
[[ru:Compiz]]
[[tr:Compiz]]
+
{{Related articles start (简体中文)}}
{{过期}}
+
{{Related|Compiz/Configuration}}
{{Article summary start|摘要}}
+
{{Related|Window manager (简体中文)}}
{{Article summary wiki|Compiz Configuration}}
+
{{Related|Desktop environment (简体中文)}}
{{Article summary wiki|AIGLX}}
+
{{Related|Xfce (简体中文)}}
{{Article summary wiki|Composite}}
+
{{Related|MATE (简体中文)}}
{{Article summary wiki|Xcompmgr (简体中文)}}
+
{{Related|Unity (简体中文)}}
{{Article summary wiki|Cairo Compmgr}}
+
{{Related articles end}}
{{Article summary end}}
+
{{Template:TranslationStatus (简体中文)|Compiz|2014-08-14|328840}}
  
Compiz 是一个 [[Wikipedia:Compositing window manager|合成窗口管理器]]。它提供了自己的[[窗口管理器]],所以它不能和其他的窗口管理器(如[[Openbox (简体中文)|Openbox]], [[Fluxbox]], [[Enlightenment]]) 同时使用。想继续使用当前的窗口管理器以及想添加更多效果的用户可以尝试 [[Xcompmgr]]
+
来自[https://zh.wikipedia.org/wiki/Compiz 维基百科]的解释:
 +
: Compiz 是第一个由 [https://zh.wikipedia.org/wiki/OpenGL OpenGL] 驱动的运行于 [https://zh.wikipedia.org/wiki/X_Window_System X Window System] 上的混合窗口管理器 。Compiz的混合渲染能力使其可以在窗口管理过程中实现多种视觉效果,比如在矩形虚拟桌面上的窗口最小化。
  
== 配置需求 ==
 
大部分的[[DE]]用户可以非常好地使用{{Pkg|compiz-manager}}来简单地检查一下当前环境是否适合安装以及在有错误出现时可以切换到原来的窗口管理器。用户亦可以使用{{AUR|compiz-check}}(在[[AUR]]仓库中)脚本来检查当前对于安装{{Pkg|compiz-manager}}有什么问题或者硬件配置还存在什么问题。
 
  
 
== 安装 ==
 
== 安装 ==
所有[[官方软件仓库]]中的包都可以用 [[pacman (简体中文)|pacman]] 安装 {{Grp|compiz-fusion}} 软件包组。
 
  
如果你不想安装所有的软件,还有软件包组 {{Grp|compiz-fusion-gtk}} 和 {{Grp|compiz-fusion-kde}} 分别适合于 [[GNOME (简体中文)|GNOME]] or [[KDE (简体中文)|KDE]]。
+
* 2013年5月起, Compiz 在[[official repositories]]中就[https://mailman.archlinux.org/pipermail/arch-dev-public/2013-May/024956.html 不再可用了]
 +
* 安装0.9和0.8版本的包可以在[[AUR (简体中文)]]中找到。
 +
* 这两个版本'''不能同时安装'''
  
Users who wish to select the packages individually may start with {{Pkg|compiz-core}} and one of [[#Decorators|decorators]].
+
=== 安装0.9系列版本 ===
{{Note|Lack of configured window decorator can render your [[X]] workspace slightly unusable.}}
 
  
=== 初始配置 ===
+
{{注意|
当窗口的外观以及内部元素时[[GTK+]]和[[Qt]]的函数时,窗口的边框将会由窗口装饰插件管理。要启用它你必须已经安装了一个窗口装饰器。你可以根据你下载的软件包从几个窗口装饰器之中选择。最常见的有Emerald, kde-window-decorator 和 gtk-window-decorator。Emerald的优势在于它能更好地处理compiz对屏幕的输出以及提供透明效果。你可以通过在"Window Decoration"插件的设置中的"Command"区域输入下面的指令来设定你的默认窗口装饰器。 例如,设置Emerald作为你的默认窗口装饰器,你可以输入:
+
*从 Compiz 0.9.8 开始,所有的Compiz组件(包括CCSM、插件、gtk-window-decorator等)都是当作一个单独项目来开发的。也就是说一个安装包就包括了Compiz的全部组件。
emerald --replace
+
*想要带 ''emerald-themes''的''emerald0.9'', 先安装{{AUR|emerald0.9}}{{Broken package link|package not found}} 再安装 {{AUR|emerald-themes}}. 相反的做法会导致依赖关系错误而冲突.}}
设置kde-window-decorator作为你的默认窗口装饰器,输入:
 
kde4-window-decorator --replace
 
设置compiz-decorator-gtk作为你的默认窗口装饰器,输入:
 
gtk-window-decorator --replace
 
  
{{Box RED|激活你的插件!|
+
必需的:
可以想到你非常有可能会想去激活一些可以提供基本的窗口管理器的行为的插件或者当compiz激活之后你将不能去拖拉,缩放或者关闭任何的窗口。因为这些插件时属于“Window Decoration"的效果而”移动窗口“以及”缩放窗口“是属于窗口管理器的。为了解决这个问题,你可以使用ccsm(CompizConfig Settings Manager)你可以通过输入以下指令来运行CompizConfig Settings Manager:
+
* {{App|Compiz|OpenGL合成管理器与CCSM,插件和GTK窗口装饰器.|https://launchpad.net/compiz|{{AUR|compiz}}}}
$ ccsm
 
你只需简单地在你需要激活的插件面前打钩即可激活它们。}}
 
  
== Additional software ==
+
可选的:
=== Decorators ===
+
* {{App|Emerald|Compiz的独立窗口装饰器|http://www.compiz.org/|{{AUR|emerald0.9}}{{Broken package link|package not found}}}}
* {{App|[[Emerald]]|Compiz's own window decorator with few dependencies. (Note: Works but is buggy and no longer maintained)|http://www.compiz.org|{{Pkg|emerald}}}}
+
* {{App|Emerald Themes| Emerald 窗口装饰的额外主题.|http://www.northfield.ws/projects/compiz/|{{AUR|emerald-themes}}}}
* {{Pkg|compiz-decorator-gtk}} and {{Pkg|compiz-decorator-kde}} – alternatives to Emerald, using your desktop environment's configuration backends and looks
+
* {{App|Fusion Icon| Compiz的托盘小程序并且可以切换不同的窗口管理器以及装饰器.|https://github.com/kozec/fusion-icon-gtk3|{{AUR|fusion-icon0.9}}{{Broken package link|package not found}}}}
=== Other ===
 
* {{Pkg|ccsm}} (CompizConfig settings manager) – GUI application that lets you configure all of Compiz's plugins
 
* {{Pkg|fusion-icon}} – offers a tray icon and a nice way to start compiz, start ccsm and change the WM / Window Decorator
 
* [https://aur.archlinux.org/packages.php?K=compiz Lots of quickly dying packages in AUR]
 
  
== 启动Compiz Fusion ==
+
=== 安装0.8系列版本 ===
  
=== 手动 (使用 "fusion-icon") ===
+
安装以下任意一个包:{{AUR|compiz-core}}、 {{AUR|compiz-gtk-standalone}}{{Broken package link|{{aur-mirror|compiz-gtk-standalone}}}} 或 {{AUR|compiz-core-mate}}{{Broken package link|package not found}}。
  
启动Compiz Fusion托盘图标:
+
需要Compiz设置中心,请安装 {{AUR|ccsm}}。
  
$ fusion-icon
+
需要插件,请安装 {{AUR|compiz-fusion-plugins-main}}、 {{AUR|compiz-fusion-plugins-extra}} 。
 +
并且可选地,可以安装 {{AUR|compiz-fusion-plugins-unsupported}}{{Broken package link|{{aur-mirror|compiz-fusion-plugins-unsupported}}}}。
 +
 
 +
Emerald窗口装饰器可以从 {{AUR|emerald}} 包中安装。
 +
需要附加的Emerald主题可以安装 {{AUR|emerald-themes}} 。
 +
 
 +
=== 窗口装饰器 ===
 +
 
 +
{{提示|想知道更多关于选择与管理主题的情况,请访问:[[Compiz configuration#Window decoration themes]]。}}
 +
 
 +
{{注意|
 +
* 大多数的Compiz软件包都会默认提供 gtk-window-decorator (一个GTK窗口装饰器组件)。唯一的例外则是 {{AUR|compiz-core}} 包中并没有提供窗口装饰器。
 +
* 目前没有任何一个包自动提供 kde-window-decorator (一个KDE窗口装饰器组件)。想要安装它,你需要编辑将要安装的 Compiz 包中的 [[PKGBUILD]] 文件,从中打开相关的选项。当你编辑完之后,还需要重新编译并安装 Compiz 包。}}
 +
 
 +
窗口装饰器是为程序提供窗口和边框的程序。
 +
不像类似{{Pkg|mutter}}之类的窗口管理器,
 +
不像Kwin或者[[Xfwm]]只提供一个唯一的装饰器,
 +
Compiz的用户拥有三个选择:Emerald、gtk-window-decorator以及kde-window-decorator。
 +
 
 +
其中gtk-window-decorator 和 the kde-window-decorator 就包含在 Compiz 的源代码中,并且已经编译好了(如果你的PKGBUILD文件设置妥当的话)。
 +
而Emerald分离在外,是一个独立的装饰器软件。
 +
 
 +
设置它可以按照如下步骤:
 +
 
 +
首先,确定你已经安装了你想要在Compiz中使用的装饰器。然后,打开 CCSM (''Compiz Config Setting Manager ,Compiz设置管理器'')。
 +
你可以找到它的图标或者在终端中运行命令: {{ic|ccsm}}。在设置界面中,找到“效果”部分,并保证“Window Decoration”(''”窗口装饰“'')已经勾选了。
 +
现在,点击“Window Decoration”(''”窗口装饰“'')按钮,并且在”命令“框中输入跟你需要的装饰器相关的命令:
 +
 
 +
* {{ic|emerald}}
  
{{注意|如果失败,可以尝试用dbus-launch启动
+
* {{ic|gtk-window-decorator}}
{{bc|$ dbus-launch "fusion-icon"}}}}
 
  
右键点击面板上的图标,选择'select window manager'->'Compiz',如果它尚未被选的话请选择它。
+
* {{ic|kde4-window-decorator}}
  
如果失败了,可以用以下命令 to replace your default window decorator with Compiz's window decorator (Emerald):
+
为了让这些改动立即生效,你可能需要在命令的结尾添加 {{ic|--replace}} 开关。
 +
另外,注销之后再登陆进来也可以让你新设置的装饰器生效。
 +
不过请注意,在CCSM中输入的使用 {{ic|--replace}} 开关的装饰器命令,会在用户登陆的时候使屏幕闪一下。
  
  $ emerald --replace
+
== 开始使用 Compiz ==
  
{{注意|If you want to use compiz window decorations make sure you have the "Window Decoration" plugin marked in the compiz settings through ccsm.}}
+
=== 启用重要的插件 ===
 +
{{提示|
 +
*''译者注'' 为了大家看得方便,我把插件的名字保留了英文。因为有时候CCSM里面也会显示英文的插件名称。
 +
*''译者注'' 插件的中文名称可能翻译得不准确。}}
  
==== 手动(不使用"fusion-icon") ====
+
在开始使用Compiz之前,
 +
你需要激活一些提供窗口管理基本功能的插件。
 +
要不然你可能连拖拽窗口都困难,更别说缩放和关闭了。
  
安装后用以下命令启动Compiz:
+
重要的插件:
  
$ compiz --replace ccp &
+
* Window Decoration(''窗口装饰'') —— 提供窗口边框(上一节咱已经讨论过了)
 +
* Move Window(''窗口移动'')
 +
* Resize Window(''窗口缩放'')
 +
* Place Windows(''窗口放置'') —— 设置关于窗口在屏幕上放置的选项
 +
* Application Switcher(''程序切换'') —— 提供 Alt+Tab 开启的程序切换器(另外也有一些插件可以实现这个功能,而且具有不同的效果,比如 'Shift Switcher,' 'Static Application Switcher' 等等。并不是所有的切换器都是用 Alt+Tab 快捷键)。
  
A quick overview over common compiz command-line options:
+
想要在不同的[[Compiz_configuration#Workspaces_and_Viewports|视区]]之间切换,你需要激活以下其中一个插件:
*--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.
 
  
=== KDE ===
+
* Desktop Cube(''立体桌面'')和Rotate Cube(''旋转立体'') —— 提供一个可以浮空的立方体,每个面都是一个视口(''虚拟桌面'')。
 +
* Desktop Wall(''桌面墙壁'') —— 视口全部并排陈列在一起(非常类似于[[Cinnamon]] 和 [[GNOME Shell]] 中的窗口切换效果)。
 +
* Expo —— 当鼠标移动到屏幕左上角的时候,显示出全部的视口和窗口(''就是Ubuntu Unity里面那种!!'')。这个插件可以单独激活,或者是和前两个一起用不会冲突。
  
==== 自动运行 (使用"fusion-icon") ====
+
=== 启动 Compiz ===
  
你需要在KDE的Autostart目录(通常为~/.kde/Autostart)下加入一个fusion-icon的符号链接:
+
{{注意|曾几何时,出现过一个包错误,导致你需要在运行 {{ic|compiz --replace}} 命令时使用 {{ic|ccp}} 开关才能正常导入Compiz插件。不过现在这个错误已经修正了,现在已经'''没有任何必要'''使用 {{ic|ccp}} 开关。}}
  
  $ ln -s /usr/bin/fusion-icon ~/.kde/Autostart/fusion-icon
+
你可以使用下面的命令启动Compiz:
 +
  $ compiz --replace &
  
下次启动KDE的时候将会自动加载fusion-icon。
+
{{提示|如果 {{ic|compiz --replace &}} 命令在进入会话时不管用。 试一试没有a花的命令: {{ic|compiz --replace}}。}}
  
{{Box 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. Read ahead to see other methods.}}
+
我们来过一下常用的Compiz命令行选项吧:
 +
* {{ic|--indirect-rendering}}: 使用间接渲染 (AIGLX)
 +
* {{ic|--loose-binding}}: 可以解决一些性能问题 (NVIDIA?)
 +
* {{ic|--replace}}: 取代现有的窗口管理器(''window-manager'')
 +
* {{ic|--keep-window-hints}}: 在可用的视口中保留Gnome窗口管理器的 gconf-settings 设置
 +
* {{ic|--sm-disable}}: 禁用会话管理功能
  
==== 自动运行 (不使用"fusion-icon") ====
+
==== 小工具 Fusion Icon ====
  
===== 方法 1 - 自动启动链接 =====
+
Fusion Icon 是一个托盘小工具,功能是在一个会话中切换Compiz和其他不同的窗口管理器以及装饰器。
 +
'''它只和Compiz 0.8版本兼容。'''
 +
它可以在 {{AUR|fusion-icon}} 包中安装。
  
* 在KDE的autostart目录里加入一个desktop entry使得Compiz Fusion在登录时启动。用以下内容创建文件{{ic|~/.kde/Autostart/compiz.desktop}}
+
你可以用下面的命令运行 fusion-icon
 +
$ fusion-icon
  
[Desktop Entry]
+
为了确保Fusion-icon确实启动了Compiz,邮件单击它在通知区域的图标,然后选择“select window manager”, 如果“Compiz”还没被选上的话就选上吧。
Type=Application
 
Encoding=UTF-8
 
Name=Compiz
 
Exec=/usr/bin/compiz ccp --replace
 
NoDisplay=true
 
# name of loadable control center module
 
X-GNOME-WMSettingsModule=compiz
 
# autostart phase
 
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 {{ic|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.}}
+
下面将要讲到的很多方法会在桌面环境启动时自动运行Compiz。你也可以叫桌面环境自动运行fusion-icon来间接自动启动Compiz。
 +
如果你想这样做的话,
 +
只要把Compiz的命令
 +
(通常都是 {{ic|compiz --replace &}})改成 {{ic|fusion-icon}} 就行了。
  
{{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 ===
  
* 如果你想要使用 {{ic|compiz.desktop}} 应用程序则运行''fusion-icon''。如果设置正确,当你在''fusion-icon''运行过程种正常注销,下次登录时KDE会恢复你的会话并启动''fusion-icon''。如果不成功,请确认{{ic|~/.kde/share/config/ksmserverrc}}中有以下内容:
+
==== KDE4 ====
  
  loginMode=restorePreviousLogout
+
===== 使用系统设置 =====
  
{{Note| This is a KDE specific setting that will allow you to restore other apps next time you log in, not just fusion-icon.}}
+
打开系统设置程序,并找到“系统设置 > 默认程序 > 窗口管理器 > 使用另外的窗口管理器'”然后选择“Compiz”。
  
===== 方法 2 - 导出KDEWM (更好的方法) =====
+
如果你需要让Compiz使用你自己设定的选项启动的话,就选择“Compiz custom”,然后新建一个叫做{{ic|compiz-kde-launcher}} 的脚本,并且在其中添加你希望启动Compiz的命令。
 +
下面是一个例子:
  
{{注意|使用本方法将使得启动时加载Compiz-Fusion而不是KWIN为缺省窗口管理器,这种方式比在~/.kde/Autostart/中加载Compiz-Fusion(方法1)要快些,因为它无须先加载KDE的缺省WM (kwin)。这种方法也避免了其它方式下KDE桌面加载过程中kwin切换到Compiz时的恼人的黑屏闪烁。}}
+
{{hc|/usr/local/bin/compiz-kde-launcher|
 +
#!/bin/bash
 +
LIBGL_ALWAYS_INDIRECT=1
 +
compiz --replace &
 +
wait
 +
}}
  
在终端里以root身份用以下命令创建一个小脚本。它使得你可以带参数加载compiz,这是因为直接用export KDEWM="compiz --replace ccp --sm-disable"无法正常工作。
+
然后还要让他可运行:
 +
$ chmod +x /usr/local/bin/compiz-kde-launcher
  
$ echo "compiz --replace ccp --sm-disable &" > /usr/bin/compiz-fusion
+
===== Autostart 自动启动链接 =====
  
{{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
+
* 如果你想安装 gtk-window-decorator,就不要新建 {{ic|compiz.desktop}} 文件,因为这回产生一些问题。
Be sure to complete the whole method before trying this substitute.}}
+
* 如果 {{ic|compiz.desktop}} 已经有了,那你可能需要在 {{ic|Exec}} 之后添加 {{ic|--replace}} 。}}
  
Ensure that {{ic|/usr/bin/compiz-fusion}} has executable (+x) permissions.
+
在KDE自动启动(''Autostart'')目录中添加一个项目。如果它不存在,就新建一个:
$ chmod a+x /usr/bin/compiz-fusion
 
  
Choose one of the following:
+
{{hc|~/.kde4/Autostart/compiz.desktop|2=
 +
[Desktop Entry]
 +
Type=Application
 +
Encoding=UTF-8
 +
Name=Compiz
 +
Exec=/usr/bin/compiz --replace
 +
NoDisplay=true
 +
# name of loadable control center module
 +
X-GNOME-WMSettingsModule=compiz
 +
# autostart phase
 +
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
 +
}}
  
:1) Compiz for your user only --> Edit the file {{ic|~/.kde4/env/compiz.sh}} and add the following line so KDE will load compiz (via the script you just created) instead of loading KWin.
+
===== 设置 KDEWM 变量 =====
: {{bc|1=KDEWM="compiz-fusion"}}
 
  
:2) Compiz system wide --> Edit the file {{ic|/etc/kde/env/compiz.sh}} and add the following line so KDE will load compiz (via the script you just created) instead of loading KWin.
+
作为root用户你需要搞一个小脚本,这样你就可以在启动Compiz的时候添加命令行选项了。
: {{bc|1=KDEWM="compiz-fusion"}}
 
  
{{Box Note| If the above method shall not work for any reason, try the replacement mentioned above.}}
+
新建一个文件,里面输入启动Compiz的命令,再加上你希望附加的设置。下面是一个例子:
{{Box Note| If that still doesn't work, yet another alternate way to accomplish the above method is to include the line
 
{{bc|1=export KDEWM="compiz-fusion"}}
 
in your user's {{ic|~/.bashrc}} file.}}
 
{{Box Note| If you optionally use the {{ic|/usr/local/bin}} directory it may not work. In that case you should export the script including the whole path:
 
{{bc|1=export KDEWM="/usr/local/bin/compiz-fusion"}}}}
 
  
===== Method 3 - Use KDE 4 System Settings =====
+
{{hc|/usr/bin/startcompiz|
Go to System Settings --> Default Applications --> Window Manager --> Use a different window manager
+
compiz --replace &
 +
}}
  
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).
+
{{注意|你不一定非要把这个脚本叫做 ''startcompiz''。只要保证你的脚本的名字不会和系统已有的命令(在{{ic|/usr/bin}}目录中)弄混就行了。 }}
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:
 
  #!/bin/bash
 
  LIBGL_ALWAYS_INDIRECT=1
 
  compiz --replace ccp &
 
  wait
 
  
=== 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.}}
 
  
==== Alternate Session for GNOME (Preferred Method for Experienced Compiz/Dock Users) ====
+
# chmod +x /usr/bin/startcompiz
The {{AUR|gnome-session-compiz}} 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 [[#Configuration|configured initially]] for fresh accounts, from another working session (ccsm in GNOME Shell worked fine for me).
+
现在你需要新建一个程序来调用你刚刚在 {{ic|/usr/bin}} 中新建的这个脚本了。
  
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:
+
1) 只针对你当前的用户设置:
* 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) ====
+
{{hc|~/.kde4/env/startcompiz.sh|2=
This Method makes use of the [http://standards.freedesktop.org/desktop-entry-spec/latest/ 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.
+
KDEWM="compiz"
 +
}}
  
'''1)'''If the following file doesn't already exist (it should), create it {{ic|/usr/share/applications/compiz.desktop}} containing the following:
+
2) 全系统范围内设置:
  
[Desktop Entry]
+
{{hc|/etc/kde/env/startcompiz.sh|2=
Type=Application
+
KDEWM="compiz"
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 folloing 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
 
  
{{Box Note| If {{ic|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:
+
$ export KDEWM="startcompiz"
  
{{bc|1=Exec=/usr/bin/compiz ccp --indirect-rendering}}
+
: 把它放到你用户的 {{ic|~/.bashrc}} 文件中去。
  
or
+
* 如果你使用了 {{ic|/usr/local/bin}} 目录那可能会不管用。那么你需要在脚本中使用绝对路径:
  
{{bc|1=Exec=/usr/bin/compiz --replace --sm-disable --ignore-desktop-hints ccp --indirect-rendering}}
+
$ export KDEWM="/usr/local/bin/startcompiz"
 +
}}
  
Instead of
+
==== GNOME 桌面环境 ====
  
{{bc|1=Exec=/usr/bin/compiz ccp}}
+
===== GNOME Shell 和 Cinnamon =====
  
Some Users noticed a "lag" of 4-10 seconds when loging in from a login manager. The solution is to change the command to:
+
[[GNOME Shell (简体中文)]] 是一个类似 {{pkg|mutter}} 的实现插件。 同样, [[Cinnamon]] 插件是一个类似于 {{Pkg|muffin}} 窗口管理器的实现。
{{bc|1=Exec=bash -c 'compiz ccp decoration --sm-client-id $DESKTOP_AUTOSTART_ID'}}
 
as noted [https://bbs.archlinux.org/viewtopic.php?pid=655237#p655237 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:
+
也就是说,将GNOME Shell 或 Cinnamon 与 Compiz 或者其他窗口管理器同时使用'''是不可能的'''(因为他们都是窗口管理器!)。
  
{{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.}}
+
===== Unity =====
  
gconftool-2 --set -t string /desktop/gnome/session/required_components/windowmanager compiz
+
确保 'Ubuntu Unity Plugin' ('''Ubuntu Unity 插件''')在 CCSM 中启用了,这样 [[Unity]] 才能正确运行。
  
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.
+
你只有正确安装了Unity之后,这个插件才会显示在CCSM里面。
  
gconftool-2 --set -t string /desktop/gnome/applications/window_manager/current /usr/bin/compiz
+
===== 其它的GNOME会话 (Cairo dock 和 Compiz) =====
gconftool-2 --set -t string /desktop/gnome/applications/window_manager/default /usr/bin/compiz
 
  
==== Autostart (without "fusion-icon") (With gnome3 fallback mode session) ====
+
{{AUR|gnome-session-compiz}}{{Broken package link|{{aur-mirror|gnome-session-compiz}}}} 包会在一个 [[display manager (简体中文)]] 中添加一个新的会话。
Edit file {{ic|/usr/share/gnome-session/sessions/gnome-fallback.session}}:
+
只要在你的显示管理器中选择 'gnome-session-compiz' 即可。
  
Replace your windows manager (gnome-shell,metacity...) with ''compiz'' in '''RequiredComponents''' line.
+
请确保 Compiz 以及 Cairo Dock (Taskbar或Panel) 已经正确的设置好了。
  
Change ''DefaultProvider-windowmanager'' line to ''DefaultProvider-windowmanager=compiz''
+
在CCSM里面,确保选择了窗口装饰器,已经启用了窗口管理需要的必要插件。详见 [[#启用重要的插件]].
  
Here is part of my {{ic|gnome-fallback.session}}:
+
下面是一些建议的Cairo Dock的设置:
  
{{bc|1=
+
* 在Cairo Dock上面添加一个应用程序菜单,并且记住它的快捷键绑定。
RequiredComponents=compiz;gnome-settings-daemon;
+
* 为了舒服,吧应用程序菜单的快捷键绑定到 {{ic|Alt+F1}} 和 {{ic|Alt+F2}}。
RequiredProviders=windowmanager;notifications;
+
* 添加时钟、Wifi、网速等等插件图标到Dock上面。
DefaultProvider-windowmanager=compiz
+
* 添加一个注销按钮:
DefaultProvider-notifications=notification-daemon
+
** 设置注销命令为 {{ic|gnome-session-quit --logout}}
}}
+
** 设置关机命令为 {{ic|gnome-session-quit --power-off}}
 +
* 添加Notification Area Old (systray) 图标('''通知区域支持''')到 Cairo Dock。
  
{{Box Note| I took out gnome-panel as I am using avant-window-navigator as my panel.
+
===== GNOME Flashback =====
I'am using gnome3 fallback mode with compiz, make gtk-window-decorator start with compiz, and make avant-window-navigator start automatically.}}
 
  
==== Autostart (without "fusion-icon", Gnome prior to 2.24) ====
+
详见:[[GNOME Flashback#Alternative window manager]].
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:
+
==== MATE 桌面环境 ====
#!/bin/bash
 
export WINDOW_MANAGER="compiz ccp"
 
exec gnome-session
 
  
and make it executable ({{ic|chmod +x /usr/local/bin/compiz-start-boot}}). Next create the file {{ic|/etc/X11/sessions/Compiz.desktop}} containing the following:
+
===== 使用 GSettings =====
[Desktop Entry]
 
Version=1.0
 
Encoding=UTF-8
 
Name=Compiz on GNOME
 
Exec=/usr/local/bin/compiz-start-boot
 
Icon=
 
Type=Application
 
  
Select Compiz on Gnome as your session and you're good to go.
+
使用下面的 GSettings 命令可以将默认的窗口管理器 {{Pkg|marco}} 改为 Compiz。
  
==== 自动运行 (使用"compiz-fusion") ====
+
$ gsettings set org.mate.session.required-components windowmanager compiz
  
要启动会话时自动运行Compiz fusion ,可将
+
===== 使用 mate-session-properties =====
  "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.
+
{{注意|当使用这种方法时,Marco会首先启动,然后自动被Compiz替换。}}
  
The ccp value will tell compiz to load your previous Compiz settings as configured with CompizConfig Settings Manager (ccsm).}}
+
另一种做法是使用mate-session-properties来启用Compiz。
 +
在终端中输入下面的命令:
  
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.
+
$ mate-session-properties
  
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.
+
单击“添加”按钮,并在“命令”文本框中输入 {{ic|compiz --replace &}} 命令。
gconftool-2 --type bool --set /apps/metacity/general/compositing_manager false
+
名称和介绍栏目并不重要,只是用来说明的,不要在意这些细节。
 +
注销再登陆,Compiz应该就会顺利启动了。
  
{{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 ====
  
=== Xfce ===
 
  
==== Xfce 自动运行 (不使用 "compiz-fusion") ====
+
===== 修改默认 (故障保护Failsafe) 会话 =====
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
+
想要设置Xfce的默认会话 (也就是故障保护 Failsafe 会话) ,可以使用 {{ic|xfconf-query}}:
  
To install the session manager, install {{Pkg|xfce4-session}}.
+
  xfconf-query -c xfce4-session -p /sessions/Failsafe/Client0_Command -t string -t string -s compiz
  
Now we have to configure the default/failsafe session of XFCE.
+
或者可以编辑下面其中之一:
 +
* 用户:{{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml}}
 +
* 系统:{{ic|/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml}}
  
Edit the {{Ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml}} or (to make the change for all XFCE users) {{Ic|/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml}}:
+
{{注意|如果 xfce4-session.xml 文件不存在于 {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml}} ,你需要去编辑 {{ic|/etc/xdg/xfce4/xfconf/xfce-perchannel-xml}}中的文件。}}
  
Replace the xfwm startup command,
+
将 [[Xfwm]] 的启动命令:
  
 
   <property name="Client0_Command" type="array">
 
   <property name="Client0_Command" type="array">
Line 318: Line 315:
 
   </property>
 
   </property>
  
with the following:
+
替换为:
  
 
   <property name="Client0_Command" type="array">
 
   <property name="Client0_Command" type="array">
 
     <value type="string" value="compiz"/>
 
     <value type="string" value="compiz"/>
    <value type="string" value="ccp"/>
 
 
   </property>
 
   </property>
  
{{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="general" type="empty">
Line 335: Line 329:
 
   </property>
 
   </property>
  
To remove the existing sessions, run:
+
然后移除已经存在的会话:
 +
 
 
  $ rm -r ~/.cache/sessions
 
  $ rm -r ~/.cache/sessions
  
==== Xfce 自动运行 (使用 "compiz-fusion") ====
+
现在你应该注销。请确保“保存默认会话”标签'''没有被勾选''',否则刚才的编辑不会生效。
=====方法一:=====
+
再次登陆,Compiz应该就会运行了。当Compiz正常运行之后,你就可以重新钩上“保存将来的会话”了。
  
这将先启动Xfcewm,然后再用Compiz替换.
 
  
启动"Autostarted Applications"
+
===== Starting Compiz from a restored Xfce session =====
  
加入
+
{{Note|If you clear your saved sessions then you will need to run through the steps of this method again.}}
  (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.
+
By default, Xfce saves its sessions on logout which means that running applications will be restored on login. Therefore, to ensure that Compiz is autostarted with each session, you merely need to ensure that Compiz is running when you logout. To do so, hit {{ic|Alt+F2}} to start the Xfce run dialog. Then run the command to start Compiz: {{ic|compiz --replace &}}. Then you just need to logout. When logging out, ensure that the "Save session for future logins" option in the Xfce logout dialog is '''ticked'''. You should find that Compiz is autostarted in all future sessions.
  
The ccp value will tell compiz to load your previous Compiz settings as configured with CompizConfig Settings Manager (ccsm).}}
+
===== Using Xfce application autostart =====
  
{{Note| This method is the least preferred since it loads both window managers. All the other XFCE methods only load Compiz without loading Xfwm.}}
+
{{Note|If this method is used, Xfwm will start first and will then be replaced by Compiz.}}
  
=====方法二:=====
+
In the Xfce main menu navigate to 'Settings' and click on 'Session and Startup.' Click on the 'Application Autostart' tab. Click the add button and in the command section enter the {{ic|compiz --replace &}} command. The name and comment sections are unimportant and are just there to indicate what the entry does. Log out and log in again and Compiz should start.  
编辑以下文件
 
$ nano ~/.conf/xfce4-session/xfce4-session.rc
 
  
或者应用到所有Xfce用户(需要root访问权限)
+
{{Tip|When using this method, it is advisable to disable saved sessions otherwise Compiz will be started twice at login which could lead to problems such as the {{ic|Alt+F4}} keybinding not working. To disable saved sessions, open the 'Session and Startup' menu entry, click on the 'Session' tab and click the 'Clear saved sessions' button. Then, untick the 'Save session for future logins' option in the Xfce logout dialog.}}
  
# nano /etc/xdg/xfce4-session/xfce4-session.rc
+
==== LXDE & LXQt ====
  
加入以下内容
+
The session files of LXDE and LXQt can be edited to start an alternative [[window manager]] (such as Compiz) with the session.
[Failsafe Session]
 
Client0_Command=fusion-icon
 
  
如果已有Client0_Command=xfwm4则注释掉它。
+
* For LXDE, see the following section: [[LXDE#Replace the default window manager]]{{Broken section link}}.
 +
* For LXQt, see the following section: [[LXQt#Replace the default window manager]]{{Broken section link}}.
  
这将使得xfce在用户没有任何sessions的情况下加载Compiz Fusion而不是xfwm4。
+
== Using Compiz as a standalone window manager ==
  
为了防止缺省session被覆盖,你还需要加入以下内容:
+
=== Starting the session with a display manager ===
[General]
 
AutoSave=false
 
SaveOnExit=false
 
  
删除已有的sessions
+
A standalone Compiz session can be started from a [[display manager]]. For most display manager's ([[LightDM]], [[LXDM]], [[GDM]] etc) all that's required is to create a .desktop file in {{ic|/usr/share/xsessions}} defining the Compiz session. See the article for your display manager to check if this is the case.
rm -R ~/.cache/sessions
 
  
=====Method 3:=====
+
Firstly, create the {{ic|/usr/share/xsessions}} directory if it does not already exist. Then create the .desktop file. A basic example is provided below:
Check if this file exists:
 
~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
 
  
If not do:
+
{{hc|/usr/share/xsessions/compiz.desktop|
cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
+
<nowiki>[Desktop Entry]
 +
Version=1.0
 +
Name=Compiz
 +
Comment=Start a standalone Compiz session
 +
Exec=compiz
 +
Type=Application</nowiki>
 +
}}
  
and edit {{Ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml}}
+
Then just choose 'Compiz' from your sessions list and log in.
  
or (to make the changes for all xfce4 users) {{Ic|/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml}}:
+
{{Note|Some display managers are stricter than others regarding the syntax of .desktop files. If a Compiz option does not appear in your display manager's session menu you will need to edit your .desktop file to make it compatible. The example above should work in most cases.}}
  
Edit Client0_Command that it look like this:
+
==== Autostarting programs when using a display manager ====
<property name="Client0_Command" type="array">
 
    <value type="string" value="fusion-icon"/>
 
    <value type="string" value="--force-compiz"/>
 
</property>
 
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''':
+
One way in which you could start programs with your Compiz session, when it is started from a [[display manager]], is to use an [[xprofile]] file. The xprofile file is similar in syntax to [[xinitrc]] - it can contain commands for programs you wish to start with your session. Most display managers will parse commands from an xprofile file by default.
<property name="general" type="empty">
+
 
    <property name="FailsafeSessionName" type="string" value="Failsafe"/>
+
Alternatively, you could use Compiz's 'Session Management' plugin. This plugin will save running programs on exit and restore them when the session is next started. Simply enable the 'Session Management' plugin in CCSM.
    <property name="SessionName" type="string" value="Default"/>
 
    <property name="SaveOnExit" type="bool" value="false"/>
 
  </property>
 
  
finally remove old xfce4 sessions:
+
=== Starting the session with startx ===
rm -r ~/.cache/sessions
 
  
Now xfce4 will load compiz instead of Xfwm.
+
To start Compiz with the {{ic|startx}} command, add the following line to your {{ic|~/.xinitrc}} file:
  
=== As a Standalone Window Manager ===
+
{{hc|~/.xinitrc|
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.
+
exec compiz
 +
}}
  
To autostart compiz-fusion configure .xinitrc to launch compiz as:
+
You can also use fusion icon as shown below:
{{hc|~/.xinitrc|<nowiki>
 
exec compiz ccp
 
</nowiki>}}
 
You can also add other [[Compiz_fusion#Manually_.28without_.22fusion-icon.22.29|command-line options]] to your .xinitrc
 
  
Or if using fusion-icon, configure .xinitrc as
+
{{hc|~/.xinitrc|
{{hc|~/.xinitrc|<nowiki>
 
 
exec fusion-icon
 
exec fusion-icon
</nowiki>}}
+
}}
  
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:
+
You can autostart additional programs (such as a panel) by adding the relevant command to your {{ic|~/.xinitrc}} file. Below is an example of a {{ic|~/.xinitrc}} file which starts Compiz, the tint2 panel and the Cairo dock.
{{hc|~/.xinitrc|<nowiki>
+
 
 +
{{hc|~/.xinitrc|
 
tint2 &
 
tint2 &
 
cairo-dock &
 
cairo-dock &
exec fusion-icon
+
exec compiz
</nowiki>}}
+
}}
 +
 
 +
See the [[xinitrc]] article for more details.
 +
 
 +
=== Add a root menu ===
 +
 
 +
To add a root menu similar to that in [[Openbox]] and other standalone window managers you can install the {{AUR|compiz-boxmenu}} package. This program is a fork of {{AUR|compiz-deskmenu}}. Among the changes that the fork introduces are the addition of some extra features such as a window list and a recent documents list.
 +
 
 +
After installing the {{AUR|compiz-boxmenu}} package, copy the config files to your home directory as shown below:
 +
 
 +
# cp -R /etc/xdg/compiz /home/''username''/.config
 +
# chown -R ''username'':''group'' /home/''username''/.config/compiz
 +
 
 +
where {{ic|username}} is your username and {{ic|group}} is the primary group for your user.
 +
 
 +
Then, open CCSM, navigate to the 'Commands' plugin and in 'Command line 0' enter the command {{ic|compiz-boxmenu}}. In the 'Key Bindings' tab, set 'Run command 0' to {{ic|Control+Space}} (you can use the 'Grab key combination' option to simplify this process.)
 +
 
 +
Now navigate to the 'Viewport Switcher' plugin and click on the 'Desktop-based Viewport Switching' tab. Change the 'Plugin for initiate action' to {{ic|core}} and change 'Action name for initiate' to {{ic|run_command0_key}}.
 +
 
 +
You should now find that a menu appears when you click {{ic|Control+Space}}. To launch a graphical menu editor, click on the 'Edit' option or run {{ic|compiz-boxmenu-editor}} in a terminal. If you would prefer to edit your menu manually, open the following file in your favourite editor: {{ic|~/.config/compiz/boxmenu/menu.xml}}. For your changes to take effect, you must click the 'Reload' option in your menu.
 +
 
 +
{{Warning|Whilst {{ic|Control+Space}} is the default keybinding for {{ic|compiz-boxmenu}} you can assign the menu to other keybindings or mousebindings as well. Take extreme care if doing so as Compiz bindings will take precedence over keybindings of all other programs. For instance, if you assign {{ic|compiz-boxmenu}} to {{ic|Button3}} then you may lose right click functionality in all programs. If the keybinding/mousebinding you are attempting to create has any conflicts, {{ic|cssm}} will notify you.}}
  
{{Note| Add a terminal-emulator to this autostart list while starting for the first time to help [[Compiz_fusion#Configuration|configure]] compiz.}}
+
=== Allow users to shutdown/reboot ===
  
An alternative method, utilizing a simple script entitled '''start-fusion.sh''':
+
An unprivileged user should be able to execute commands such as {{ic|systemctl poweroff}} and {{ic|systemctl reboot}}. You could assign a keyboard shortcut to one of these commands using the 'Commands' plugin in CCSM. Alternatively, you could create a launcher for one of these commands in {{AUR|compiz-boxmenu}} - see above. For more detailed information on shutting down see the following article: [[Allow users to shutdown]].
{{hc|start-fusion.sh|<nowiki>
 
#!/bin/sh
 
# add more apps here if necessary or start another panel, tray like pypanel, bmpanel, stalonetray
 
xfce4-panel&
 
fusion-icon
 
</nowiki>}}
 
If this script dosn't work for you, or you get issues with '''dbus''' utilize this script:
 
{{hc|start-fusion.sh|<nowiki>
 
#!/bin/sh
 
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
 
xfce4-panel&
 
fusion-icon
 
</nowiki>}}
 
Make it executable
 
  
chmod +x start-fusion.sh
+
=== Utilities ===
  
And add it to .xinitrc, like this:
+
==== Panels & docks ====
{{hc|~/.xinitrc|<nowiki>
 
exec /path/to/file/start-fusion.sh
 
</nowiki>}}
 
  
Feel free to use a different panel, tray, or start a whole bunch of applications with your session.
+
There are a number of panels and docks available in Arch however only a few are compatible with Compiz's [[Compiz_configuration#Workspaces_and_Viewports|viewports]]. They are listed below:
See [https://bbs.archlinux.org/viewtopic.php?id=51282 this forum thread] for more info.
 
  
==== Add a root menu ====
+
*{{Pkg|xfce4-panel}}
To add a root menu similar to that in Openbox, Fluxbox, Blackbox etc. you must install the package {{AUR|compiz-deskmenu}}.
+
*{{Pkg|mate-panel}}
Upon a restart of Compiz-Fusion, you should be able to middle click on your desktop to launch the menu.
+
*{{AUR|perlpanel}}{{Broken package link|package not found}}
 +
*{{Pkg|gnome-panel}}
 +
*{{Pkg|cairo-dock}}
  
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.
+
{{Note|Other [[List of applications#Taskbars_.2F_panels_.2F_docks|panels and docks]]{{Broken section link}} can be run with Compiz however their desktop pagers will show only one virtual desktop and all window buttons will be shown in all viewports regardless of which viewport the window happens to be in.}}
  
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.
+
==== Run dialog ====
  
An alternative is to use [https://aur.archlinux.org/packages.php?ID=29564 mygtkmenu], also in [[AUR]].
+
*{{Pkg|mate-panel}} provides a run dialog. To enable it, see the following section: [[Compiz#MATE Panel]]{{Broken section link}}.
 +
*{{Pkg|gnome-panel}} provides a run dialog. To enable it, see the following section: [[Compiz#GNOME Panel]]{{Broken section link}}.
 +
*{{Pkg|lxpanel}} provides a run dialog. To enable it, see the following section: [[Compiz#LXDE Panel]]{{Broken section link}}.
  
==== Allow users to shutdown/reboot ====
+
{{Note|The panels mentioned above must be running in order to use their respective run dialogs.}}
Refer to [[Allow_Users_to_Shutdown|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.
 
  
== Misc ==
+
Alternatively you could install one of the following:
  
=== Configuration  ===
+
*{{Pkg|xfce4-appfinder}} - use the following command to launch a run dialog: {{ic|xfce4-appfinder --collapsed}}
[[Compiz#Configuration|You must do this so your windows function like you expect them to!]]
+
*{{AUR|bbrun}} - use the following command to launch a run dialog: {{ic|bbrun -w}}
 +
*{{pkg|gmrun}} - use the following command to launch a run dialog: {{ic|gmrun}}
 +
*{{AUR|fbrun}}{{Broken package link|{{aur-mirror|fbrun}}}} - use the following command to launch a run dialog: {{ic|fbrun}}
  
=== Using compiz-manager ===
+
In each case, simply map the command to {{ic|Alt+F2}} (or a key combination of your choice) via the 'Commands' plugin in CCSM.
  
In order to use compiz-manager, you need to install it from community:
+
== 小技巧大放送 ==
pacman -S compiz-manager
 
  
Compiz-manager, that is now installed in {{ic|/usr/bin/compiz-manager}}, is a simple wrapper for Compiz and ALL of its options. For example, you can run
+
=== 还原原生窗口管理器 ===
compiz-manager
 
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 ===
+
你可以用下面的命令把Compiz改回你桌面环境原生的窗口管理器:
  
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.
+
''wm_name'' --replace
  
=== gconf: Additional Compiz Configurations ===
+
使用 {{ic|kwin}}、 {{ic|metacity}} 或 {{ic|xfwm4}} 替换掉 {{ic|wm_name}}.
  
To achieve more satisfying results from Compiz, you can tweak its config with gconf-editor:
+
=== 启用 Alt+F2 运行对话框 ===
  
$ gconf-editor
+
==== GNOME Panel ====
  
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.
+
在CCSM中启用 'Gnome Compatibility' 插件。
The Compiz gconf configuration is located in in the key <b>apps</b> > <b>compiz</b> > <b>general</b> > <b>allscreens</b> > <b>options</b>.
 
  
"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 <b>apps</b> > <b>compiz</b> > <b>plugins</b> to see possible values). Plugins I’ve found useful are screenshot, png, fade, and minimize. Please do not remove those enabled by default.
+
==== MATE Panel ====
  
=== ATI R600/R700 Notes ===
+
有两种方法在Compiz中启动 MATE Panel 中的运行对话框,你自己选吧:
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">
+
* 在CCSM中启用 'Gnome Compatibility' 插件
  <value type="string" value="LIBGL_ALWAYS_INDIRECT=1"/>
+
* 使用“命令”(''Commands'')插件,设置 {{ic|Alt+F2}} 快捷键的绑定如下:
  <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"/>
 
</property>
 
  
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
+
  mate-panel --run-dialog
  
LIBGL_ALWAYS_INDIRECT=1 compiz --sm-disable --ignore-desktop-hints ccp --indirect-rendering
+
==== LXDE Panel ====
  
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.
+
使用“命令”(''Commands'')插件,设置 {{ic|Alt+F2}} 快捷键的绑定如下:
  
== Tips and tricks ==
+
lxpanelctl run
=== Fallback ===
 
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
+
==== Xfce 程序查看器(''Appfinder'') ====
  
with kwin, metacity or xfwm4 instead of ''wm_name''.
+
当在Xfce会话中使用Compiz时,运行对话框(由{{Pkg|xfce4-appfinder}}提供)无需任何干预应该管用。
  
=== Keyboard Shortcuts ===
+
但是如果你是在Compiz独立会话中使用程序查看器的话,请查看这一章节:[[Compiz#Run dialog]]{{Broken section link}}。
Default plugin keyboard shortcuts (plugins have to be activated!)
 
  
* Switch windows = {{ic|Alt + Tab}}
+
==== 其他的运行对话框功能 ====
* Switch desktops on cube = {{ic|Ctrl + Alt + Left/Right Arrow}}
 
* Move window = {{ic|Alt + left-click}}
 
* Resize window = {{ic|Alt + right-click}}
 
  
A more detailed list can be found under [http://wiki.compiz-fusion.org/CommonKeyboardShortcuts CommonKeyboardShortcuts] in the Compiz wiki or you can always just look at your plugin's configuration (ccsm).
+
请查看这一章节:[[Compiz#Run dialog]]{{Broken section link}}。
  
 
== 疑难排解 ==
 
== 疑难排解 ==
  
* 请确认没有设置$XLIB_SKIP_ARGB_VISUALS环境变量
+
=== Missing GLX_EXT_texture_from_pixmaps ===
 +
 
 +
==== On ATI cards (first solution) ====
 +
 
 +
You may run into the following error when trying to run Compiz on an ATI card:
 +
 
 +
Missing GLX_EXT_texture_from_pixmap
 +
 
 +
This is because Compiz's binary was compiled against Mesa's OpenGL library rather than ATI's OpenGL library.
 +
 
 +
Firstly, copy the library into a directory to keep it because ATI's drivers will over write it: 
 +
 +
$ install -Dm644 /usr/lib/libGL.so.1.2 /usr/lib/mesa/libGL.so.1.2
 +
Then you can reinstall your fglrx drivers.  Now start Compiz as shown below:
 +
 +
LD_PRELOAD=/usr/lib/mesa/libGL.so.1.2 compiz --replace &
 +
 
 +
==== On ATI cards (second solution) ====
 +
 
 +
Another possible problem with 'GLX_EXT_texture_from_pixmap' on ATI cards is that the card can only render it indirectly. If so, you have to pass the option to your libgl as shown below:
 +
 
 +
LIBGL_ALWAYS_INDIRECT=1 compiz --replace &
 +
 
 +
(Workaround tested on the following card : ATI Technologies Inc Radeon R250 [Mobility FireGL 9000] (rev 02))
 +
 
 +
==== On Intel chips ====
  
=== KDE恢复===
+
Firstly, check that you're using the intel driver as opposed to i810. Then, run the following command to run Compiz (This must be used every time).
 +
LIBGL_ALWAYS_INDIRECT=true compiz --replace --sm-disable &
  
如果在KDE中Compiz Fusion出了问题,例如窗口边框消失,可以通过下面的命令切换回KWIN:
+
=== Compiz starts without window borders with NVIDIA binary drivers ===
  
  kwin --replace
+
Firstly, ensure that your window decorator settings are configured correctly - see the following: [[Compiz#Starting the window decorator]]{{Broken section link}}. If window borders still do not start try adding ''Option "AddARGBGLXVisuals" "True"'' and ''Option "DisableGLXRootClipping" "True"'' to your "Screen" section in {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}. If window borders still do not load and you have used other Options elsewhere in {{ic|/etc/X11/xorg.conf.d/}} try commenting them out and using only the aformentioned ARGBGLXVisuals and GLXRootClipping Options.
  
=== GNOME恢复===
+
=== Blank screen on resume from suspend-to-ram using the NVIDIA binary drivers ===
  
如果在GNOME中Compiz Fusion出了问题,例如窗口边框消失,可以通过下面的命令切换回metacity:
+
If you receive a blank screen with a responsive cursor upon resume, try disabling sync to vblank. To do so, open CCSM, navigate to the 'OpenGL' plugin and untick the 'Sync to VBlank' option.
  
metacity --replace
+
=== Poor performance from capable graphics cards ===
  
=== 运行Compiz Fusion时提示:缺少GLX_EXT_texture_from_pixmaps(ATI显卡)===
+
'''NVIDIA and Intel chips''': If everything is configured correctly but you still have poor performance with some effects, try disabling ''CCSM > General Options > Display Settings > Detect Refresh Rate'' and instead choose a value manually.
  
==== 解决方法1 ====
+
'''NVIDIA chips only''': The inadequate refresh rate with 'Detect Refresh Rate' may be 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 {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, and then restarting your computer:
  
如果在ATI显卡上运行Compiz Fusion时提示:
+
  Option "DynamicTwinView" "False"
  缺少GLX_EXT_texture_from_pixmaps
 
  
这是因为Compiz Fusion的二进制文件是针对Mesa的OpenGL库编译的。重新安装libgl-dri(这需要先临时卸载fglrx)来获得Mesa的OpenGL库。然后把库文件拷贝到一个目录保存起来(ATI驱动会覆
+
=== Screen flicks with NVIDIA card ===
  
盖它):
+
To fix this behaviour create the file below:
   
+
{{hc|/etc/modprobe.d/nvidia.conf|2=
  mkdir /lib/mesa
+
options nvidia NVreg_RegistryDwords="PerfLevelSrc=0x2222"
cp /usr/lib/libGL.so.1.2 /lib/mesa
+
}}
 +
 
 +
=== Compiz effects not working (GConf backend) ===
 +
 
 +
If you have installed the gtk-window-decorator, check if the GConf schema was correctly installed:
 +
 
 +
  $ gconftool-2 -R /apps/compiz/plugins | grep plugins
 +
 
 +
Make sure that all plugins are listed. If they are not, try to install the Compiz schema manually (do '''not''' run this command as root):
 +
 
 +
  $ gconftool-2 --install-schema-file=/usr/share/gconf/schemas/compiz-decorator-gtk.schemas
 +
 
 +
=== Fusion Icon fails to start ===
 +
 
 +
If you get an output like this from the command line:
 +
{{hc|$ 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/interface.py", line 23, in <module>
 +
    import start
 +
  File "/usr/lib/python2.5/site-packages/FusionIcon/start.py", line 36, in <module>
 +
    config.check()
 +
  File "/usr/lib/python2.5/site-packages/FusionIcon/util.py", line 362, in check
 +
    os.makedirs(self.config_folder)
 +
  File "/usr/lib/python2.5/os.py", line 172, in makedirs
 +
    mkdir(name, mode)
 +
OSError: [Errno 13] Permission denied: '/home/andy/.config/compiz'
 +
}}
 +
 
 +
the problem is with the permission on {{ic|~/.config/compiz/}}. To fix it, use:
 +
 
 +
# chown -R ''username'' /home/''username''/.config/compiz/
 +
 
 +
=== Alt+F4 keybinding not working (Xfce) ===
 +
 
 +
See the following section: [[Compiz#Using Xfce application autostart]]{{Broken section link}}.
 +
 
 +
=== Emerald refuses to start (crashes with a segfault) ===
  
然后重新安装fglrx包,然后使用下面的命令来启动Compiz Fusion:
+
You may find that Emerald fails to start with your Compiz session and attempting to start it from a terminal gives you the following output (or something similar):
 
LD_PRELOAD=/lib/mesa/libGL.so.1.2 compiz --replace &
 
  
==== 解决方法2 ====
+
Segmentation fault (core dumped)
  
可能出现的与GLX_EXT_texture_from_pixmap有关的另一个问题是:显卡不能进行直接渲染。你必须为libgl传递以下参数:
+
In this case, the solution is to reset the Emerald theme settings:
  LIBGL_ALWAYS_INDIRECT=1 compiz --replace ccp &
 
  
(在以下显卡中测试成功: ATI Technologies Inc Radeon R250 [Mobility FireGL 9000] (rev 02))
+
$ rm -rf ~/.emerald/theme
  
在2007-10-17,[http://wiki.compiz-fusion.org/Troubleshooting Compiz-Fusion Wiki]显示: <i>"如果你使用Intel GMA显卡的AIGLX,你需要在启动Compiz Fusion时附加参数:
+
Emerald should now start successfully.
  
LIBGL_ALWAYS_INDIRECT=1。</i>"
+
=== No system bell when Compiz is running ===
  
=== Fusion-Icon显示红色的叉,菜单中没有图标 ===
+
You may find that the system bell (such as the drip sound played when pressing backspace at the beginning of a line in GNOME or MATE Terminal) will not sound if Compiz is running. See the following [https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/537703 upstream bug report].
  
需要刷新GTK图标缓存(希望以后在安装包中加入该功能)。运行以下命令:
+
For [[PulseAudio]] users the following workaround is available:
# gtk-update-icon-cache -f /usr/share/icons/hicolor
 
如果上面的命令不起作用,安装hicolor-icon-theme包试试:
 
# pacman -S hicolor-icon-theme
 
新社区软件包已修复此问题。
 
  
=== Compiz已启动,但是没有效果 ===
+
Append the following lines
  
如果你已经安装了compiz-decorator-gtk:
+
load-sample-lazy bell /usr/share/sounds/freedesktop/stereo/bell.oga
检查一下GConf schema有无正确安装:
+
load-module module-x11-bell sample=bell
  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
 
  
=== Compiz已启动,但是gtk-window-decorator没有启动 ===
+
to your {{ic|/etc/pulse/default.pa}} file and then restart Pulseaudio.
  
这是gconf和gconfd的配置问题。我使用的是KDE,通过删除home下的.gonf解决了此问题。如果你使用Gnome, you should enter your ".gconf" directory and remove all compiz keys. You'll loose your Compiz settings tough!
+
=== Compiz crashes when enabling the Gnome Compatibility plugin (GSettings backend) ===
Finally exec as user:
 
  
  gconftool-2 --install-schema-file=/usr/share/gconf/schemas/compiz-decorator-gtk.schemas
+
If you are using the GSettings backend, you may find that Compiz crashes if you try to enable the 'Gnome Compatibility' plugin. In order to enable this plugin whilst using the GSettings backend you need to open CCSM and navigate to 'Preferences.' Under the header 'Integration' untick the box labelled 'Enable integration into the desktop environment.' After unticking this option, you should find it possible to enable the 'Gnome Compatibility' plugin.
  
===使用Nvidia二进制驱动从挂起到内存状态中唤醒时白屏===
+
== Known issues ==
  
如果唤醒时机器白屏,只剩下鼠标可以动,可以尝试禁止掉sync to vblank:
+
=== Xfce panel window buttons are not refreshed when a window changes viewport ===
  
gconftool -s /apps/compiz/general/screen0/options/sync_to_vblank-t boolean false
+
You may find that if you right click on a window title and choose an option such as 'Move to Workspace Right' then the window will move but the window button will still be visible in the viewport the window moved from until you switch viewports. See the following [https://bugzilla.xfce.org/show_bug.cgi?id=10908 upstream bug report].
  
===fusion-icon无法启动===
+
=== Compiz crashes when enabling the D-Bus plugin ===
如果从命令行上得到这样的输出:
 
[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/interface.py", line 23, in <module>
 
    import start
 
  File "/usr/lib/python2.5/site-packages/FusionIcon/start.py", line 36, in <module>
 
    config.check()
 
  File "/usr/lib/python2.5/site-packages/FusionIcon/util.py", line 362, in check
 
    os.makedirs(self.config_folder)
 
  File "/usr/lib/python2.5/os.py", line 172, in makedirs
 
    mkdir(name, mode)
 
OSError: [Errno 13] Permission denied: '/home/andy/.config/compiz'
 
  
这个问题和~/.config/compiz的权限设置有关。可以以root身份设置此目录的拥有者为你的普通用户:
+
The D-Bus plugin will cause Compiz to crash if enabled in conjunction with certain other plugins such as the Cube plugin. See the following [https://bugs.launchpad.net/compiz/+bug/959395 upstream bug report].
chown <username> /home/<username>/.config/compiz
 
  
===视频回放===
+
== See also ==
如果你在Compiz下无法看到视频回放,可以将视频输出换为OpenGL之类。在VLC中可以在Settings->Video->Output modules的advanced options里找到。
 
  
== 其它资源 ==
+
* [https://launchpad.net/compiz Compiz in Launchpad]
*[[AIGLX]]
+
* [http://compiz.org Compiz Home], including wiki and forum (website and wiki are unmaintained)
*[[Composite]] -- A Xorg extension required by composite managers
+
* [http://wiki.compiz.org/Troubleshooting Troubleshooting - Compiz Wiki], (wiki is unmaintained)
*[[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]] -- <strike>A composite/window manager forked from Compiz</strike> (since merged to become [[Compiz Fusion]])
 
*Wikipedia: [[wikipedia:Compositing_window_manager|Compositing Window Managers]]
 

Latest revision as of 15:56, 22 September 2018

翻译状态: 本文是英文页面 Compiz翻译,最后翻译时间:2014-08-14,点击这里可以查看翻译后英文页面的改动。

来自维基百科的解释:

Compiz 是第一个由 OpenGL 驱动的运行于 X Window System 上的混合窗口管理器 。Compiz的混合渲染能力使其可以在窗口管理过程中实现多种视觉效果,比如在矩形虚拟桌面上的窗口最小化。


Contents

安装

安装0.9系列版本

注意:
  • 从 Compiz 0.9.8 开始,所有的Compiz组件(包括CCSM、插件、gtk-window-decorator等)都是当作一个单独项目来开发的。也就是说一个安装包就包括了Compiz的全部组件。
  • 想要带 emerald-themesemerald0.9, 先安装emerald0.9AUR[broken link: package not found] 再安装 emerald-themesAUR. 相反的做法会导致依赖关系错误而冲突.

必需的:

  • Compiz — OpenGL合成管理器与CCSM,插件和GTK窗口装饰器.
https://launchpad.net/compiz || compizAUR

可选的:

  • Emerald — Compiz的独立窗口装饰器
http://www.compiz.org/ || emerald0.9AUR[broken link: package not found]
  • Emerald Themes — Emerald 窗口装饰的额外主题.
http://www.northfield.ws/projects/compiz/ || emerald-themesAUR
  • Fusion Icon — Compiz的托盘小程序并且可以切换不同的窗口管理器以及装饰器.
https://github.com/kozec/fusion-icon-gtk3 || fusion-icon0.9AUR[broken link: package not found]

安装0.8系列版本

安装以下任意一个包:compiz-coreAURcompiz-gtk-standaloneAUR[broken link: archived in aur-mirror]compiz-core-mateAUR[broken link: package not found]

需要Compiz设置中心,请安装 ccsmAUR

需要插件,请安装 compiz-fusion-plugins-mainAURcompiz-fusion-plugins-extraAUR 。 并且可选地,可以安装 compiz-fusion-plugins-unsupportedAUR[broken link: archived in aur-mirror]

Emerald窗口装饰器可以从 emeraldAUR 包中安装。 需要附加的Emerald主题可以安装 emerald-themesAUR

窗口装饰器

提示: 想知道更多关于选择与管理主题的情况,请访问:Compiz configuration#Window decoration themes
注意:
  • 大多数的Compiz软件包都会默认提供 gtk-window-decorator (一个GTK窗口装饰器组件)。唯一的例外则是 compiz-coreAUR 包中并没有提供窗口装饰器。
  • 目前没有任何一个包自动提供 kde-window-decorator (一个KDE窗口装饰器组件)。想要安装它,你需要编辑将要安装的 Compiz 包中的 PKGBUILD 文件,从中打开相关的选项。当你编辑完之后,还需要重新编译并安装 Compiz 包。

窗口装饰器是为程序提供窗口和边框的程序。 不像类似mutter之类的窗口管理器, 不像Kwin或者Xfwm只提供一个唯一的装饰器, Compiz的用户拥有三个选择:Emerald、gtk-window-decorator以及kde-window-decorator。

其中gtk-window-decorator 和 the kde-window-decorator 就包含在 Compiz 的源代码中,并且已经编译好了(如果你的PKGBUILD文件设置妥当的话)。 而Emerald分离在外,是一个独立的装饰器软件。

设置它可以按照如下步骤:

首先,确定你已经安装了你想要在Compiz中使用的装饰器。然后,打开 CCSM (Compiz Config Setting Manager ,Compiz设置管理器)。 你可以找到它的图标或者在终端中运行命令: ccsm。在设置界面中,找到“效果”部分,并保证“Window Decoration”(”窗口装饰“)已经勾选了。 现在,点击“Window Decoration”(”窗口装饰“)按钮,并且在”命令“框中输入跟你需要的装饰器相关的命令:

  • emerald
  • gtk-window-decorator
  • kde4-window-decorator

为了让这些改动立即生效,你可能需要在命令的结尾添加 --replace 开关。 另外,注销之后再登陆进来也可以让你新设置的装饰器生效。 不过请注意,在CCSM中输入的使用 --replace 开关的装饰器命令,会在用户登陆的时候使屏幕闪一下。

开始使用 Compiz

启用重要的插件

提示:
  • 译者注 为了大家看得方便,我把插件的名字保留了英文。因为有时候CCSM里面也会显示英文的插件名称。
  • 译者注 插件的中文名称可能翻译得不准确。

在开始使用Compiz之前, 你需要激活一些提供窗口管理基本功能的插件。 要不然你可能连拖拽窗口都困难,更别说缩放和关闭了。

重要的插件:

  • Window Decoration(窗口装饰) —— 提供窗口边框(上一节咱已经讨论过了)
  • Move Window(窗口移动
  • Resize Window(窗口缩放
  • Place Windows(窗口放置) —— 设置关于窗口在屏幕上放置的选项
  • Application Switcher(程序切换) —— 提供 Alt+Tab 开启的程序切换器(另外也有一些插件可以实现这个功能,而且具有不同的效果,比如 'Shift Switcher,' 'Static Application Switcher' 等等。并不是所有的切换器都是用 Alt+Tab 快捷键)。

想要在不同的视区之间切换,你需要激活以下其中一个插件:

  • Desktop Cube(立体桌面)和Rotate Cube(旋转立体) —— 提供一个可以浮空的立方体,每个面都是一个视口(虚拟桌面)。
  • Desktop Wall(桌面墙壁) —— 视口全部并排陈列在一起(非常类似于CinnamonGNOME Shell 中的窗口切换效果)。
  • Expo —— 当鼠标移动到屏幕左上角的时候,显示出全部的视口和窗口(就是Ubuntu Unity里面那种!!)。这个插件可以单独激活,或者是和前两个一起用不会冲突。

启动 Compiz

注意: 曾几何时,出现过一个包错误,导致你需要在运行 compiz --replace 命令时使用 ccp 开关才能正常导入Compiz插件。不过现在这个错误已经修正了,现在已经没有任何必要使用 ccp 开关。

你可以使用下面的命令启动Compiz:

$ compiz --replace &
提示: 如果 compiz --replace & 命令在进入会话时不管用。 试一试没有a花的命令: compiz --replace

我们来过一下常用的Compiz命令行选项吧:

  • --indirect-rendering: 使用间接渲染 (AIGLX)
  • --loose-binding: 可以解决一些性能问题 (NVIDIA?)
  • --replace: 取代现有的窗口管理器(window-manager
  • --keep-window-hints: 在可用的视口中保留Gnome窗口管理器的 gconf-settings 设置
  • --sm-disable: 禁用会话管理功能

小工具 Fusion Icon

Fusion Icon 是一个托盘小工具,功能是在一个会话中切换Compiz和其他不同的窗口管理器以及装饰器。 它只和Compiz 0.8版本兼容。 它可以在 fusion-iconAUR 包中安装。

你可以用下面的命令运行 fusion-icon :

$ fusion-icon

为了确保Fusion-icon确实启动了Compiz,邮件单击它在通知区域的图标,然后选择“select window manager”, 如果“Compiz”还没被选上的话就选上吧。

下面将要讲到的很多方法会在桌面环境启动时自动运行Compiz。你也可以叫桌面环境自动运行fusion-icon来间接自动启动Compiz。 如果你想这样做的话, 只要把Compiz的命令 (通常都是 compiz --replace &)改成 fusion-icon 就行了。

让你的桌面环境自动启动Compiz

KDE4

使用系统设置

打开系统设置程序,并找到“系统设置 > 默认程序 > 窗口管理器 > 使用另外的窗口管理器'”然后选择“Compiz”。

如果你需要让Compiz使用你自己设定的选项启动的话,就选择“Compiz custom”,然后新建一个叫做compiz-kde-launcher 的脚本,并且在其中添加你希望启动Compiz的命令。 下面是一个例子:

/usr/local/bin/compiz-kde-launcher
#!/bin/bash
LIBGL_ALWAYS_INDIRECT=1
compiz --replace &
wait

然后还要让他可运行:

$ chmod +x /usr/local/bin/compiz-kde-launcher
Autostart 自动启动链接
注意:
  • 如果你想安装 gtk-window-decorator,就不要新建 compiz.desktop 文件,因为这回产生一些问题。
  • 如果 compiz.desktop 已经有了,那你可能需要在 Exec 之后添加 --replace

在KDE自动启动(Autostart)目录中添加一个项目。如果它不存在,就新建一个:

~/.kde4/Autostart/compiz.desktop
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Compiz
Exec=/usr/bin/compiz --replace
NoDisplay=true
# name of loadable control center module
X-GNOME-WMSettingsModule=compiz
# autostart phase
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
设置 KDEWM 变量

作为root用户你需要搞一个小脚本,这样你就可以在启动Compiz的时候添加命令行选项了。

新建一个文件,里面输入启动Compiz的命令,再加上你希望附加的设置。下面是一个例子:

/usr/bin/startcompiz
compiz --replace &
注意: 你不一定非要把这个脚本叫做 startcompiz。只要保证你的脚本的名字不会和系统已有的命令(在/usr/bin目录中)弄混就行了。

保证你的脚本可执行:

# chmod +x /usr/bin/startcompiz

现在你需要新建一个程序来调用你刚刚在 /usr/bin 中新建的这个脚本了。

1) 只针对你当前的用户设置:

~/.kde4/env/startcompiz.sh
KDEWM="compiz"

2) 全系统范围内设置:

/etc/kde/env/startcompiz.sh
KDEWM="compiz"
注意:
  • 如果上面的方法不管用,使用下面的命令可以达到同样的目的:
$ export KDEWM="startcompiz"
把它放到你用户的 ~/.bashrc 文件中去。
  • 如果你使用了 /usr/local/bin 目录那可能会不管用。那么你需要在脚本中使用绝对路径:
$ export KDEWM="/usr/local/bin/startcompiz"

GNOME 桌面环境

GNOME Shell 和 Cinnamon

GNOME Shell (简体中文) 是一个类似 mutter 的实现插件。 同样, Cinnamon 插件是一个类似于 muffin 窗口管理器的实现。

也就是说,将GNOME Shell 或 Cinnamon 与 Compiz 或者其他窗口管理器同时使用是不可能的(因为他们都是窗口管理器!)。

Unity

确保 'Ubuntu Unity Plugin' (Ubuntu Unity 插件)在 CCSM 中启用了,这样 Unity 才能正确运行。

你只有正确安装了Unity之后,这个插件才会显示在CCSM里面。

其它的GNOME会话 (Cairo dock 和 Compiz)

gnome-session-compizAUR[broken link: archived in aur-mirror] 包会在一个 display manager (简体中文) 中添加一个新的会话。 只要在你的显示管理器中选择 'gnome-session-compiz' 即可。

请确保 Compiz 以及 Cairo Dock (Taskbar或Panel) 已经正确的设置好了。

在CCSM里面,确保选择了窗口装饰器,已经启用了窗口管理需要的必要插件。详见 #启用重要的插件.

下面是一些建议的Cairo Dock的设置:

  • 在Cairo Dock上面添加一个应用程序菜单,并且记住它的快捷键绑定。
  • 为了舒服,吧应用程序菜单的快捷键绑定到 Alt+F1Alt+F2
  • 添加时钟、Wifi、网速等等插件图标到Dock上面。
  • 添加一个注销按钮:
    • 设置注销命令为 gnome-session-quit --logout
    • 设置关机命令为 gnome-session-quit --power-off
  • 添加Notification Area Old (systray) 图标(通知区域支持)到 Cairo Dock。
GNOME Flashback

详见:GNOME Flashback#Alternative window manager.

MATE 桌面环境

使用 GSettings

使用下面的 GSettings 命令可以将默认的窗口管理器 marco 改为 Compiz。

$ gsettings set org.mate.session.required-components windowmanager compiz
使用 mate-session-properties
注意: 当使用这种方法时,Marco会首先启动,然后自动被Compiz替换。

另一种做法是使用mate-session-properties来启用Compiz。 在终端中输入下面的命令:

$ mate-session-properties

单击“添加”按钮,并在“命令”文本框中输入 compiz --replace & 命令。 名称和介绍栏目并不重要,只是用来说明的,不要在意这些细节。 注销再登陆,Compiz应该就会顺利启动了。

Xfce

修改默认 (故障保护Failsafe) 会话

想要设置Xfce的默认会话 (也就是故障保护 Failsafe 会话) ,可以使用 xfconf-query:

 xfconf-query -c xfce4-session -p /sessions/Failsafe/Client0_Command -t string -t string -s compiz

或者可以编辑下面其中之一:

  • 用户:~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
  • 系统:/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
注意: 如果 xfce4-session.xml 文件不存在于 ~/.config/xfce4/xfconf/xfce-perchannel-xml ,你需要去编辑 /etc/xdg/xfce4/xfconf/xfce-perchannel-xml中的文件。

Xfwm 的启动命令:

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

替换为:

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

为了保护默认会话不被覆盖,你可能需要使用:

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

然后移除已经存在的会话:

$ rm -r ~/.cache/sessions

现在你应该注销。请确保“保存默认会话”标签没有被勾选,否则刚才的编辑不会生效。 再次登陆,Compiz应该就会运行了。当Compiz正常运行之后,你就可以重新钩上“保存将来的会话”了。


Starting Compiz from a restored Xfce session
Note: If you clear your saved sessions then you will need to run through the steps of this method again.

By default, Xfce saves its sessions on logout which means that running applications will be restored on login. Therefore, to ensure that Compiz is autostarted with each session, you merely need to ensure that Compiz is running when you logout. To do so, hit Alt+F2 to start the Xfce run dialog. Then run the command to start Compiz: compiz --replace &. Then you just need to logout. When logging out, ensure that the "Save session for future logins" option in the Xfce logout dialog is ticked. You should find that Compiz is autostarted in all future sessions.

Using Xfce application autostart
Note: If this method is used, Xfwm will start first and will then be replaced by Compiz.

In the Xfce main menu navigate to 'Settings' and click on 'Session and Startup.' Click on the 'Application Autostart' tab. Click the add button and in the command section enter the compiz --replace & command. The name and comment sections are unimportant and are just there to indicate what the entry does. Log out and log in again and Compiz should start.

Tip: When using this method, it is advisable to disable saved sessions otherwise Compiz will be started twice at login which could lead to problems such as the Alt+F4 keybinding not working. To disable saved sessions, open the 'Session and Startup' menu entry, click on the 'Session' tab and click the 'Clear saved sessions' button. Then, untick the 'Save session for future logins' option in the Xfce logout dialog.

LXDE & LXQt

The session files of LXDE and LXQt can be edited to start an alternative window manager (such as Compiz) with the session.

Using Compiz as a standalone window manager

Starting the session with a display manager

A standalone Compiz session can be started from a display manager. For most display manager's (LightDM, LXDM, GDM etc) all that's required is to create a .desktop file in /usr/share/xsessions defining the Compiz session. See the article for your display manager to check if this is the case.

Firstly, create the /usr/share/xsessions directory if it does not already exist. Then create the .desktop file. A basic example is provided below:

/usr/share/xsessions/compiz.desktop
[Desktop Entry]
Version=1.0
Name=Compiz
Comment=Start a standalone Compiz session
Exec=compiz
Type=Application

Then just choose 'Compiz' from your sessions list and log in.

Note: Some display managers are stricter than others regarding the syntax of .desktop files. If a Compiz option does not appear in your display manager's session menu you will need to edit your .desktop file to make it compatible. The example above should work in most cases.

Autostarting programs when using a display manager

One way in which you could start programs with your Compiz session, when it is started from a display manager, is to use an xprofile file. The xprofile file is similar in syntax to xinitrc - it can contain commands for programs you wish to start with your session. Most display managers will parse commands from an xprofile file by default.

Alternatively, you could use Compiz's 'Session Management' plugin. This plugin will save running programs on exit and restore them when the session is next started. Simply enable the 'Session Management' plugin in CCSM.

Starting the session with startx

To start Compiz with the startx command, add the following line to your ~/.xinitrc file:

~/.xinitrc
exec compiz

You can also use fusion icon as shown below:

~/.xinitrc
exec fusion-icon

You can autostart additional programs (such as a panel) by adding the relevant command to your ~/.xinitrc file. Below is an example of a ~/.xinitrc file which starts Compiz, the tint2 panel and the Cairo dock.

~/.xinitrc
tint2 &
cairo-dock &
exec compiz

See the xinitrc article for more details.

Add a root menu

To add a root menu similar to that in Openbox and other standalone window managers you can install the compiz-boxmenuAUR package. This program is a fork of compiz-deskmenuAUR. Among the changes that the fork introduces are the addition of some extra features such as a window list and a recent documents list.

After installing the compiz-boxmenuAUR package, copy the config files to your home directory as shown below:

# cp -R /etc/xdg/compiz /home/username/.config
# chown -R username:group /home/username/.config/compiz

where username is your username and group is the primary group for your user.

Then, open CCSM, navigate to the 'Commands' plugin and in 'Command line 0' enter the command compiz-boxmenu. In the 'Key Bindings' tab, set 'Run command 0' to Control+Space (you can use the 'Grab key combination' option to simplify this process.)

Now navigate to the 'Viewport Switcher' plugin and click on the 'Desktop-based Viewport Switching' tab. Change the 'Plugin for initiate action' to core and change 'Action name for initiate' to run_command0_key.

You should now find that a menu appears when you click Control+Space. To launch a graphical menu editor, click on the 'Edit' option or run compiz-boxmenu-editor in a terminal. If you would prefer to edit your menu manually, open the following file in your favourite editor: ~/.config/compiz/boxmenu/menu.xml. For your changes to take effect, you must click the 'Reload' option in your menu.

Warning: Whilst Control+Space is the default keybinding for compiz-boxmenu you can assign the menu to other keybindings or mousebindings as well. Take extreme care if doing so as Compiz bindings will take precedence over keybindings of all other programs. For instance, if you assign compiz-boxmenu to Button3 then you may lose right click functionality in all programs. If the keybinding/mousebinding you are attempting to create has any conflicts, cssm will notify you.

Allow users to shutdown/reboot

An unprivileged user should be able to execute commands such as systemctl poweroff and systemctl reboot. You could assign a keyboard shortcut to one of these commands using the 'Commands' plugin in CCSM. Alternatively, you could create a launcher for one of these commands in compiz-boxmenuAUR - see above. For more detailed information on shutting down see the following article: Allow users to shutdown.

Utilities

Panels & docks

There are a number of panels and docks available in Arch however only a few are compatible with Compiz's viewports. They are listed below:

Note: Other panels and docks[broken link: invalid section] can be run with Compiz however their desktop pagers will show only one virtual desktop and all window buttons will be shown in all viewports regardless of which viewport the window happens to be in.

Run dialog

Note: The panels mentioned above must be running in order to use their respective run dialogs.

Alternatively you could install one of the following:

  • xfce4-appfinder - use the following command to launch a run dialog: xfce4-appfinder --collapsed
  • bbrunAUR - use the following command to launch a run dialog: bbrun -w
  • gmrun - use the following command to launch a run dialog: gmrun
  • fbrunAUR[broken link: archived in aur-mirror] - use the following command to launch a run dialog: fbrun

In each case, simply map the command to Alt+F2 (or a key combination of your choice) via the 'Commands' plugin in CCSM.

小技巧大放送

还原原生窗口管理器

你可以用下面的命令把Compiz改回你桌面环境原生的窗口管理器:

wm_name --replace

使用 kwinmetacityxfwm4 替换掉 wm_name.

启用 Alt+F2 运行对话框

GNOME Panel

在CCSM中启用 'Gnome Compatibility' 插件。

MATE Panel

有两种方法在Compiz中启动 MATE Panel 中的运行对话框,你自己选吧:

  • 在CCSM中启用 'Gnome Compatibility' 插件
  • 使用“命令”(Commands)插件,设置 Alt+F2 快捷键的绑定如下:
mate-panel --run-dialog

LXDE Panel

使用“命令”(Commands)插件,设置 Alt+F2 快捷键的绑定如下:

lxpanelctl run

Xfce 程序查看器(Appfinder

当在Xfce会话中使用Compiz时,运行对话框(由xfce4-appfinder提供)无需任何干预应该管用。

但是如果你是在Compiz独立会话中使用程序查看器的话,请查看这一章节:Compiz#Run dialog[broken link: invalid section]

其他的运行对话框功能

请查看这一章节:Compiz#Run dialog[broken link: invalid section]

疑难排解

Missing GLX_EXT_texture_from_pixmaps

On ATI cards (first solution)

You may run into the following error when trying to run Compiz on an ATI card:

Missing GLX_EXT_texture_from_pixmap

This is because Compiz's binary was compiled against Mesa's OpenGL library rather than ATI's OpenGL library.

Firstly, copy the library into a directory to keep it because ATI's drivers will over write it:

$ install -Dm644 /usr/lib/libGL.so.1.2 /usr/lib/mesa/libGL.so.1.2

Then you can reinstall your fglrx drivers. Now start Compiz as shown below:

LD_PRELOAD=/usr/lib/mesa/libGL.so.1.2 compiz --replace &

On ATI cards (second solution)

Another possible problem with 'GLX_EXT_texture_from_pixmap' on ATI cards is that the card can only render it indirectly. If so, you have to pass the option to your libgl as shown below:

LIBGL_ALWAYS_INDIRECT=1 compiz --replace &

(Workaround tested on the following card : ATI Technologies Inc Radeon R250 [Mobility FireGL 9000] (rev 02))

On Intel chips

Firstly, check that you're using the intel driver as opposed to i810. Then, run the following command to run Compiz (This must be used every time).

LIBGL_ALWAYS_INDIRECT=true compiz --replace --sm-disable &

Compiz starts without window borders with NVIDIA binary drivers

Firstly, ensure that your window decorator settings are configured correctly - see the following: Compiz#Starting the window decorator[broken link: invalid section]. If window borders still do not start try adding Option "AddARGBGLXVisuals" "True" and Option "DisableGLXRootClipping" "True" to your "Screen" section in /etc/X11/xorg.conf.d/20-nvidia.conf. If window borders still do not load and you have used other Options elsewhere in /etc/X11/xorg.conf.d/ try commenting them out and using only the aformentioned ARGBGLXVisuals and GLXRootClipping Options.

Blank screen on resume from suspend-to-ram using the NVIDIA binary drivers

If you receive a blank screen with a responsive cursor upon resume, try disabling sync to vblank. To do so, open CCSM, navigate to the 'OpenGL' plugin and untick the 'Sync to VBlank' option.

Poor performance from capable graphics cards

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

NVIDIA chips only: The inadequate refresh rate with 'Detect Refresh Rate' may be 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/20-nvidia.conf, and then restarting your computer:

Option "DynamicTwinView" "False"

Screen flicks with NVIDIA card

To fix this behaviour create the file below:

/etc/modprobe.d/nvidia.conf
options nvidia NVreg_RegistryDwords="PerfLevelSrc=0x2222"

Compiz effects not working (GConf backend)

If you have installed the gtk-window-decorator, check if the GConf schema was correctly installed:

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

Make sure that all plugins are listed. If they are not, try to install the Compiz schema manually (do not run this command as root):

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

Fusion Icon fails to start

If you get an output like this from the command line:

$ 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/interface.py", line 23, in <module>
    import start
  File "/usr/lib/python2.5/site-packages/FusionIcon/start.py", line 36, in <module>
    config.check()
  File "/usr/lib/python2.5/site-packages/FusionIcon/util.py", line 362, in check
    os.makedirs(self.config_folder)
  File "/usr/lib/python2.5/os.py", line 172, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/andy/.config/compiz'

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

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

Alt+F4 keybinding not working (Xfce)

See the following section: Compiz#Using Xfce application autostart[broken link: invalid section].

Emerald refuses to start (crashes with a segfault)

You may find that Emerald fails to start with your Compiz session and attempting to start it from a terminal gives you the following output (or something similar):

Segmentation fault (core dumped)

In this case, the solution is to reset the Emerald theme settings:

$ rm -rf ~/.emerald/theme

Emerald should now start successfully.

No system bell when Compiz is running

You may find that the system bell (such as the drip sound played when pressing backspace at the beginning of a line in GNOME or MATE Terminal) will not sound if Compiz is running. See the following upstream bug report.

For PulseAudio users the following workaround is available:

Append the following lines

load-sample-lazy bell /usr/share/sounds/freedesktop/stereo/bell.oga
load-module module-x11-bell sample=bell

to your /etc/pulse/default.pa file and then restart Pulseaudio.

Compiz crashes when enabling the Gnome Compatibility plugin (GSettings backend)

If you are using the GSettings backend, you may find that Compiz crashes if you try to enable the 'Gnome Compatibility' plugin. In order to enable this plugin whilst using the GSettings backend you need to open CCSM and navigate to 'Preferences.' Under the header 'Integration' untick the box labelled 'Enable integration into the desktop environment.' After unticking this option, you should find it possible to enable the 'Gnome Compatibility' plugin.

Known issues

Xfce panel window buttons are not refreshed when a window changes viewport

You may find that if you right click on a window title and choose an option such as 'Move to Workspace Right' then the window will move but the window button will still be visible in the viewport the window moved from until you switch viewports. See the following upstream bug report.

Compiz crashes when enabling the D-Bus plugin

The D-Bus plugin will cause Compiz to crash if enabled in conjunction with certain other plugins such as the Cube plugin. See the following upstream bug report.

See also