温馨提示×

linux compton在哪配置

小樊
35
2026-09-25 01:29:35
栏目: 智能运维

在 Linux 中,Compton(现在多被 fork 为 picom)的配置文件位置和方式取决于你使用的发行版和安装方式。下面按常见情况说明:


一、Compton 配置文件位置

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

~/.config/compton.conf

或

~/.compton.conf

如果不存在,可以自己创建:

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

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

/etc/xdg/compton.conf

或

/usr/share/doc/compton/examples/compton.conf

(有些发行版会提供示例文件)


二、Compton 示例配置(基础)

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

保存后重启 compton:

killall compton
compton --config ~/.config/compton.conf &

三、如果你用的是 picom(Compton 的继任者)

很多新系统已经用 picom 替代 compton:

配置文件位置:

~/.config/picom/picom.conf

启动:

picom --config ~/.config/picom/picom.conf

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

which compton
which picom

五、桌面环境相关

  • i3 / bspwm / awesome:手动启动 compton/picom
  • GNOME / KDE:通常不需要 compton(自带合成器)
  • Openbox / Fluxbox:常用 compton

如果你告诉我:

  • 发行版(Ubuntu / Arch / Debian?)
  • 窗口管理器(i3 / Openbox?)
  • 用的是 compton 还是 picom

我可以给你完全对应的配置示例。

0 踩