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