sudo apt update && sudo apt install compton
注:部分新系统可能默认使用picom(Compton分支),可尝试安装picom替代。
配置文件路径:~/.config/compton.conf(若不存在则手动创建)
mkdir -p ~/.config/compton/
nano ~/.config/compton.conf
常用配置选项:
backend = "glx"(性能优先)或"xrender"(兼容性优先)shadow = true(启用阴影)、opacity = 0.8(窗口透明度0.8)vsync = true(防止画面撕裂)ignore_root = true(避免桌面环境冲突)blur = true(启用背景模糊,需显卡支持)killall compton # 先停止进程
compton -b & # 后台启动(-b参数)
或通过系统启动程序添加compton -b实现开机自启。
ps aux | grep comptonjournalctl -u compton(若使用systemd)glx后端并关闭shadow/blur。cpulimit限制CPU占用,例如cpulimit -l 50 -p $(pgrep compton)。参考来源: