在 Linux 系统中配置 Compton 窗口合成器可以帮助你获得更好的窗口透明度和视觉效果。以下是详细的配置步骤:
安装 Compton
在基于 Debian 的发行版(如 Ubuntu)中,使用以下命令安装 Compton:
sudo apt-get install compton
在基于 Arch 的发行版中,使用以下命令安装 Compton:
sudo pacman -S compton
编辑 Compton 配置文件
-
找到配置文件:
- 配置文件通常位于
/.config/compton.conf
。如果文件不存在,可以创建一个。 - 使用以下命令创建并打开配置文件:
touch /.config/compton.conf nano /.config/compton.conf
- 配置文件通常位于
-
常用配置选项:
-b
:启用背景模糊。bg_blur true
-r
:启用阴影。shadow true
-s
:启用屏幕边缘模糊。screen_edge_blur true
-c
:禁用窗口透明。opacity false
--vsync
:启用垂直同步。vsync true
--ignore-glx-glitz
:忽略 OpenGL 加速。ignore_glx_glitz true
-
保存并关闭配置文件。
重启 Compton 服务
在基于 Debian 和 Ubuntu 的系统中,使用以下命令重启 Compton 服务:
sudo systemctl restart compton
在基于 Fedora 和 RHEL 的系统中,使用以下命令重启 Compton 服务:
sudo systemctl restart compton.service
现在,Compton 应该已经根据您的设置运行了。您可以根据需要调整配置文件中的选项,以达到最佳的视觉效果和性能。