Compton 是一個輕量級的窗口合成器,通常用于與窗口管理器(如 Openbox、i3 等)配合使用,提供更好的視覺效果和性能。雖然 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
在 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