温馨提示×

ubuntu compton配置在哪改

小樊
37
2026-10-21 16:38:15
栏目: 智能运维

在 Ubuntu 里 Compton(现在多被 picom 取代)的配置文件位置和修改方式如下:


一、Compton 配置文件位置

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

~/.config/compton.conf

或(新版改名为 picom):

~/.config/picom.conf

如果没有这个文件,可以自己创建:

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

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

/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 / picom 启动方式

如果你是 手动启动:

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

或

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

如果是 开机自启(Ubuntu + GNOME):

  • 打开「启动应用程序」
  • 添加命令:
picom

或

compton

四、注意(很重要)

✅ Ubuntu 20.04+ 基本都用 picom 了

  • 包名:picom
  • 命令:picom
  • 配置:~/.config/picom.conf

❌ 老版 compton 在新系统里可能已经不存在

查看是否安装:

which compton
which picom

如果你愿意,可以告诉我:

  • Ubuntu 版本
  • 用的是 GNOME / KDE / XFCE
  • 想实现什么效果(毛玻璃、阴影、掉帧优化)

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

0 踩