安装Compton
打开终端,执行命令:
sudo apt update && sudo apt install compton
(部分新系统可能需安装picom,可尝试sudo apt install picom)
创建/编辑配置文件
配置文件路径为~/.config/compton.conf,若不存在则创建:
mkdir -p ~/.config/compton
compton --example-config > ~/.config/compton/compton.conf
或直接使用文本编辑器(如nano)手动创建:
nano ~/.config/compton.conf
常用配置选项
在配置文件中可调整以下参数(示例):
backend = glx # 后端,可选xrender/glx(glx需显卡支持OpenGL,性能更优)
vsync = true # 垂直同步
shadow = true # 窗口阴影
opacity = 0.8 # 窗口透明度(0.0-1.0)
ignore_root = true # 忽略根窗口透明度(避免部分桌面环境冲突)
启动Compton
compton --config ~/.config/compton.conf -b
(-b表示后台运行)~/.xprofile或桌面环境的“自动启动程序”中。重启生效
保存配置后,重启Compton或系统:
pkill compton && compton --config ~/.config/compton.conf -b
注意:
/etc/gdm3/custom.conf禁用Wayland。backend=glx或限制CPU占用(如cpulimit -l 50 -p $(pgrep compton))。