温馨提示×

linux compton配置在哪改

小樊
53
2026-09-12 16:13:43
栏目: 智能运维

在 Linux 中,Compton(现在更多被维护为 picom)的配置文件位置和修改方式如下:


一、配置文件位置

1️⃣ 用户级配置(最常用)

~/.config/compton.conf

或(picom 常见):

~/.config/picom.conf

如果没有,可以手动创建:

mkdir -p ~/.config
touch ~/.config/compton.conf

2️⃣ 系统级配置(不推荐改)

/etc/compton.conf
/etc/xdg/compton.conf

或

/etc/picom.conf

二、怎么改配置

用任意文本编辑器打开,例如:

nano ~/.config/compton.conf

常见配置示例:

backend = "glx";
shadow = true;
opacity-rule = [
  "90:class_g = 'Alacritty'"
];

三、怎么让配置生效

修改后重启 compton / picom:

killall compton
compton &

或(picom):

killall picom
picom &

如果用了窗口管理器(i3 / bspwm / openbox),也可以在配置里加:

exec --no-startup-id compton

四、确认你用的是 compton 还是 picom

which compton
which picom

现代发行版(Arch / Ubuntu 22+)基本都用 picom。


如果你告诉我:

  • 发行版(Ubuntu / Arch / Debian)
  • 窗口管理器(i3 / bspwm / KDE / GNOME)
  • 想实现什么效果(透明 / 阴影 / 性能优化)

我可以直接给你一份可用的配置。

0 踩