在 CentOS 下配置 compton(现在社区更多用 fork 版 picom),大致步骤如下。下面以 compton 为主说明,同时给出 picom 的注意点。
sudo yum install -y epel-release
sudo yum install -y compton
CentOS 8 / Stream 可能仓库里没有 compton,可改用 picom(见后文)。
compton 默认读取:
~/.config/compton.conf
或
~/.compton.conf
# 关闭阴影
shadow = false
# 开启透明
opacity-rule = [
"90:class_g = 'URxvt'",
"80:class_g = 'Firefox'"
]
# 后台运行
daemon = true
# 使用 GLX 后端(性能更好)
backend = "glx"
# 合成刷新
vsync = true
# 忽略某些窗口
unredir-if-possible = true
保存为 ~/.config/compton.conf
compton --config ~/.config/compton.conf &
在窗口管理器启动命令里加:
exec compton --config ~/.config/compton.conf
如果黑屏或卡顿,可改:
backend = "xrender"
建议直接用 picom:
sudo dnf install picom
配置文件路径相同:
~/.config/picom.conf
启动:
picom --config ~/.config/picom.conf &
查看是否运行:
ps aux | grep compton
看日志:
compton --config ~/.config/compton.conf --verbose
如果你能告诉我:
我可以给你 更精确的一套配置。