Xcompmgr

来自 Arch Linux 中文维基

Xcompmgr是一个简单的混合窗口管理器,可以实现阴影、原生窗口透明(配合transset工具)等特效。Xcompmgr设计初衷只是实现混合窗口管理器的概念,所以比起同类混合窗口管理器如 Compiz Fusion,Xcompmgr轻量许多。

Xcompmgr不替代任何窗口管理器,所以对于OpenboxFluxbox这类缺乏特效的窗口管理器来讲,配合Xcompmgr能得到更华丽的视觉效果。

安装[编辑 | 编辑源代码]

在安装 Xcompmgr 前,请先确认您已经正确安装并配置了 Xorg。如果你使用了自定义配置,请打开X服务器中的 Composite 拓展。

您可以直接从官方软件仓库中安装xcompmgr以及透明度设置工具transset-dfAUR

配置[编辑 | 编辑源代码]

运行 xcompmgr

$ xcompmgr -c

如果要在每次 Xorg 启动时运行,添加以下内容到xprofile

xcompmgr -c &

用户可以通过命令行参数调整阴影、消隐等效果,以下是一个常用的配置:

xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 &

查看命令行帮助:

$ xcompmgr --help

窗口透明度[编辑 | 编辑源代码]

transset-df 工具用来设置单个窗口的透明度,透明特效可能会降低系统性能。

先启动要设置透明度的程序,然后运行:

transset-df n

.. 此处 n 是0到1之间的数字,0表示完全透明(不可见),1表示不透明。例如:transset .25 代表75%的透明度。

运行后,鼠标会变成十字形。点击要设置的窗口,即可应用透明度设置。

小提示[编辑 | 编辑源代码]

方便开关xcompmgr的脚本[编辑 | 编辑源代码]

把这个脚本放在合适的应用程序目录,可以方便地启动、关闭xcompmgr。

#!/bin/bash
#
# Start a composition manager.
# (xcompmgr in this case)

comphelp() {
  echo "Composition Manager:"
  echo "   (re)start: COMP"
  echo "   stop:      COMP -s"
  echo "   query:     COMP -q"
  echo "              returns 0 if composition manager is running, else 1"
  exit
}

checkcomp() {
  pgrep xcompmgr &>/dev/null
}

stopcomp() {
  checkcomp && killall xcompmgr
}

startcomp() {
  stopcomp
# Example settings only. Replace with your own.
  xcompmgr -CcfF -I-.015 -O-.03 -D6 -t-1 -l-3 -r4.2 -o.5 &
  exit
}

case "$1" in
    "") startcomp ;;
  "-q") checkcomp ;;
  "-s") stopcomp; exit ;;
     *) comphelp ;;
esac

仅用一个快捷键就切换 xcompmgr[编辑 | 编辑源代码]

利用上面脚本的状态部分,将下面脚本设置为某个快捷键的脚本:

#!/bin/bash

if pgrep xcompmgr &>/dev/null; then
       echo "Turning xcompmgr ON"
       xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 &
else
       echo "Turning xcompmgr OFF"
       pkill xcompmgr &
fi

exit 0

疑难解答[编辑 | 编辑源代码]

Mozilla Firefox 打开 Flash 时崩溃[编辑 | 编辑源代码]

新建可执行文件/etc/profile.d/flash.sh,文件内容如下:

export XLIB_SKIP_ARGB_VISUALS=1

这将关闭混合特效。

登录后变成浅灰色背景 (如Openbox)[编辑 | 编辑源代码]

安装hsetroot,在运行xcompmgr之前,执行hsetroot -solid "#000000"(将000000替换成你想要的颜色代码)。

在 awesome 窗口管理器中出现 BadPicture request[编辑 | 编辑源代码]

如果你在 awesome 得到以下错误信息:

 error 163: BadPicture request 149 minor 8 serial 34943
 error 163: BadPicture request 149 minor 8 serial 34988
 error 163: BadPicture request 149 minor 8 serial 35033

只需要安装软件包 feh 然后重启 awesome

Screen not updating in awesome after resolution change[编辑 | 编辑源代码]

When using an external monitor, you may encounter problems when automatically changing display resolutions: a part of the screen becomes "stuck" and no longer updates itself. This problem occurs because of the initial resolution change (happening before Xcompmgr starts) as well as awesome setting the background via feh.

To fix it, you need to 安装 hsetroot and put the following line in .xinitrc, just before xcompmgr:

hsetroot -solid "#000066"

(you can replace #000066 with your color of choice).