在 Linux 上让 compton(或已更名为 picom) 的配置生效,通常需要下面几个步骤。不同发行版和桌面环境略有差异,但核心流程一致。
很多发行版中:
compton 已停止维护检查命令:
which compton
which picom
如果只有 picom,下面所有 compton 命令换成 picom 即可。
compton / picom 默认读取的配置文件:
~/.config/compton.conf
# 或
~/.config/picom.conf
如果是旧版 compton,用 compton.conf;picom 推荐 picom.conf。
compton --config ~/.config/compton.conf
或 picom:
picom --config ~/.config/picom.conf
如果没报错,说明配置已生效。
compton -b # 后台运行
compton --shadow # 开启阴影
compton -CG # 忽略某些窗口(常见配置)
设置 → 会话和启动 → 应用程序自启
添加:
compton --config ~/.config/compton.conf
系统设置 → 开机和关机 → 自动启动
在窗口管理器的配置文件中加:
exec --no-startup-id compton --config ~/.config/compton.conf
编辑:
~/.xprofile
添加:
compton --config ~/.config/compton.conf &
compton 不会自动重载配置,需要:
pkill compton
compton --config ~/.config/compton.conf
pkill -USR1 picom
(不一定所有版本支持)
排查:
ps aux | grep compton
尝试最小化配置:
backend = "glx";
vsync = true;
backend = "glx";
vsync = true;
shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;
fade = true;
如果你愿意,可以告诉我:
我可以给你一份完全针对性的配置和启动方式。