在CentOS中安装Compton的步骤如下:
更新系统:
sudo yum update -y
安装依赖包:
sudo yum install -y wget git cmake make libX11-devel libXext-devel libXrender-devel libxtst-devel libxi-devel libxcursor-devel libxrandr-devel libxinerama-devel libxcomposite-devel libasound2-plugins
下载Compton源码:
git clone https://github.com/channable/compton.git
cd compton
编译并安装:
mkdir build && cd build
cmake ..
make -j$(nproc)
sudo make install
创建配置文件:
mkdir -p ~/.config/compton
nano ~/.config/compton.conf
编辑配置文件:根据你的需要调整配置文件中的设置。例如:
# 启用背景模糊
bg_blur = true
# 启用阴影
shadow = true
# 启用屏幕边缘模糊
screen_edge_blur = true
# 禁用窗口透明
opacity = false
# 启用垂直同步
vsync = true
# 忽略OpenGL加速
ignore_glx_glitz = true
启动Compton:
compton &
设置Compton开机自启(可选):
sudo systemctl enable compton
你可以通过打开一个应用程序窗口,检查阴影效果是否生效,来验证Compton是否正常工作。
请注意,Compton是一个用于Wayland显示服务器的复合管理器,它可以将多个显示器的图像合成为一个,并提供一些视觉效果。如果你的系统使用的是X11而不是Wayland,Compton可能不会工作。此外,Compton的某些功能可能需要特定的图形硬件和驱动支持。