在CentOS上配置Compton一般有以下步骤:
- 安装Compton:
- 更新系统:
sudo yum update -y。 - 安装Compton:
sudo yum install compton(CentOS 7等)或sudo dnf install compton(CentOS 8等)。
- 更新系统:
- 配置Compton:
- 创建或编辑配置文件:通常位于
~/.config/compton.conf或/etc/compton.conf,可用nano或vim编辑。 - 常见配置选项有
backend(后端,如glx或xrender)、shadow(阴影设置)、opacity(透明度)等。
- 创建或编辑配置文件:通常位于
- 启动Compton:
- 手动启动:
compton -c /path/to/config.conf(/path/to/config.conf替换为实际配置文件路径)。 - 设置开机自启动:创建
/etc/systemd/system/compton.service文件,添加内容[Unit] Description=Compton Compositor After=display-manager.service [Service] ExecStart=/usr/bin/compton -c /path/to/config.conf Restart=always [Install] WantedBy=multi-user.target,然后执行sudo systemctl enable compton.service和sudo systemctl start compton.service。
- 手动启动:
- 验证配置:通过
systemctl status compton.service查看服务状态,确保Compton正常运行。