以下是在CentOS中配置Compton的步骤:
sudo yum update -y
sudo yum install compton -y
sudo yum install snapd -y
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install compton --classic
/.config/compton.conf
或/etc/compton.conf
。backend
(设置后端,如glx
)、shadow
(控制阴影)、opacity
(设置透明度)等。例如:
nano /.config/compton.conf
backend = "glx"; shadow = true; opacity = 0.8
compton --config /.config/compton.conf
。/etc/systemd/system/compton.service
。[Unit]
Description=Compton Compositor
After=graphical.target
[Service]
ExecStart=/usr/bin/compton --config /.config/compton.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo systemctl enable compton
sudo systemctl start compton
ps aux | grep compton
查看进程,或查看日志文件(若有配置log-file
选项)来验证。