以下是一些CentOS中Compton的配置技巧:
确保系统更新,安装EPEL仓库(若需),然后使用yum
或dnf
安装Compton。
配置文件通常位于~/.config/compton.conf
,可使用文本编辑器编辑。常用配置选项包括:
backend
:设置渲染后端,如glx
或xrender
。shadow
:控制窗口阴影,可设为true
或false
。opacity
:设置窗口透明度,取值0-1。vsync
:控制垂直同步,true
或false
。手动启动用compton -c ~/.config/compton.conf
。创建systemd服务文件/etc/systemd/system/compton.service
实现开机自启,内容示例:
[Unit]
Description=Compton Compositor
After=graphical.target
[Service]
ExecStart=/usr/bin/compton -c ~/.config/compton.conf
Restart=on-failure
[Install]
WantedBy=graphical.target
然后执行sudo systemctl enable compton
和sudo systemctl start compton
。
关闭不必要的特效,如阴影和透明度;使用GPU加速;用cpulimit
限制资源使用。