在CentOS中啟用Compton,可以按照以下步驟進行:
更新系統包
sudo yum update -y
安裝Compton
sudo yum install compton -y
創建或編輯Compton配置文件
Compton的默認配置文件通常位于/etc/compton.conf
。你可以直接編輯這個文件,或者創建一個新的配置文件。
sudo nano /etc/compton.conf
以下是一個基本的配置示例:
backend = "glx";
glx-no-stencil = true;
glx-copy-from-front = true;
glx-shm-config = "size=1024M";
glx-vsync = false;
shadow-exclude = "[class='GtkWindow']";
fade = true;
opacity-rule = [
"opacity=0.5; class_g='GtkPanel'",
"opacity=0.75; class_g='GtkStatusbar'"
];
啟動Compton服務
sudo systemctl start compton
設置Compton開機自啟
sudo systemctl enable compton
驗證Compton是否運行
ps aux | grep compton
你應該能看到Compton進程正在運行。
安裝snapd
sudo yum install snapd -y
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
安裝Compton
sudo snap install compton --classic
創建或編輯Compton配置文件
同樣,你可以編輯/etc/compton.conf
或者創建一個新的配置文件。
啟動Compton服務
sudo systemctl start compton
設置Compton開機自啟
sudo systemctl enable compton
驗證Compton是否運行
ps aux | grep compton
通過以上步驟,你應該能夠在CentOS系統中成功啟用并配置Compton。