温馨提示×

ubuntu compton在哪配置

小樊
33
2026-10-07 01:09:52
栏目: 智能运维

在 Ubuntu 上,Compton(现在更多被称为 picom,Compton 已停止维护,picom 是其活跃分支)的配置文件位置和方式如下:


一、配置文件位置

默认配置文件路径

~/.config/compton.conf

或(如果是 picom):

~/.config/picom.conf

如果该文件不存在,可以手动创建。


二、如何创建/编辑配置

1. 创建配置目录(如果没有)

mkdir -p ~/.config

2. 创建配置文件

touch ~/.config/compton.conf

或

touch ~/.config/picom.conf

3. 编辑配置

gedit ~/.config/compton.conf

或用 vim:

vim ~/.config/compton.conf

三、启动时使用指定配置

Compton

compton --config ~/.config/compton.conf

Picom

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

你可以把它加到:

  • 开机启动项
  • ~/.xprofile
  • 或窗口管理器启动脚本(i3 / bspwm / openbox 等)

四、示例配置(compton / picom 通用)

backend = "glx";
vsync = true;

shadow = true;
shadow-radius = 12;
shadow-opacity = 0.5;

fade = true;
fade-in-step = 0.03;
fade-out-step = 0.03;

opacity-rule = [
  "90:class_g = 'Firefox'",
  "95:class_g = 'Terminal'"
];

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

which compton
which picom

现代 Ubuntu(20.04+)一般推荐:

sudo apt install picom

如果你告诉我:

  • 用的是 Ubuntu 桌面版(GNOME) 还是 i3 / bspwm / openbox
  • 是 compton 还是 picom

我可以给你更精确的配置和开机启动方法。

0 踩