在 Ubuntu 里 Compton(现在多被 picom 取代)的配置文件位置和修改方式如下:
~/.config/compton.conf
或(新版改名为 picom):
~/.config/picom.conf
如果没有这个文件,可以自己创建:
mkdir -p ~/.config
touch ~/.config/compton.conf
/etc/compton.conf
/etc/xdg/compton.conf
用文本编辑器打开即可,比如:
gedit ~/.config/compton.conf
或
nano ~/.config/compton.conf
示例配置:
backend = "glx";
opacity-rule = [
"90:class_g = 'Firefox'"
];
shadow = true;
fade = true;
如果你是 手动启动:
compton --config ~/.config/compton.conf
或
picom --config ~/.config/picom.conf
如果是 开机自启(Ubuntu + GNOME):
picom
或
compton
✅ Ubuntu 20.04+ 基本都用 picom 了
picompicom~/.config/picom.conf❌ 老版 compton 在新系统里可能已经不存在
查看是否安装:
which compton
which picom
如果你愿意,可以告诉我:
我可以给你一份可直接用的配置。