Compton 是一个轻量级的窗口合成器,通常用于与窗口管理器(如 Openbox、i3 等)配合使用,提供更好的视觉效果和性能。虽然 Compton 本身主要是一个合成器,而不是一个脚本语言解释器,但你可以通过编写配置文件来实现一些自定义效果。
Compton 配置文件
Compton 的配置文件通常位于 ~/.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
使用 Systemd 管理 Compton 服务
在 Debian 和 Ubuntu 系统中,你可以使用 Systemd 来管理 Compton 服务。首先,确保 Compton 已经安装:
sudo apt-get install compton
然后,编辑或创建 Systemd 服务文件:
sudo vim /etc/systemd/system/compton.service
在文件中添加以下内容:
[Unit] Description=Compton Window Composer After=display-manager.target [Service] Type=simple ExecStart=/usr/bin/compton --config ~/.config/compton.conf Restart=always [Install] WantedBy=multi-user.target
保存并关闭文件后,重启 Compton 服务以应用更改:
sudo systemctl daemon-reload sudo systemctl restart compton