Compton在Ubuntu上的启动方法
在启动Compton前,需先通过包管理器安装。打开终端,运行以下命令更新包列表并安装Compton:
sudo apt update
sudo apt install compton
安装完成后,可通过终端直接运行以下命令启动Compton:
compton
~/.config/compton.conf):compton --config ~/.config/compton.conf
若需要Compton在每次系统启动时自动运行,可通过以下两种方式实现:
sudo nano /etc/systemd/system/compton.service
[Unit]
Description=Compton Window Composer
After=graphical.target
[Service]
ExecStart=/usr/bin/compton --config ~/.config/compton.conf
Restart=on-failure
User=$USER
Group=$USER
[Install]
WantedBy=graphical.target
Ctrl+O→Enter→Ctrl+X),随后执行以下命令启用并启动服务:sudo systemctl daemon-reload
sudo systemctl enable compton
sudo systemctl start compton
compton.desktop文件:nano ~/.config/autostart/compton.desktop
[Desktop Entry]
Type=Application
Name=Compton
Exec=compton --config ~/.config/compton.conf
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
启动后,可通过以下命令检查Compton进程是否运行:
ps aux | grep compton
若输出中包含compton进程(如/usr/bin/compton --config ~/.config/compton.conf),则说明启动成功。
picom(Compton的fork,对X11支持更好)。backend(如改为x11)或关闭不必要的特效(如阴影)。~/.cache/compton.log)定位错误原因。