插件窝 干货文章 Linux Compton配置文件在哪

Linux Compton配置文件在哪

picom 配置 Compton config 531    来源:    2025-05-04

在Linux系统中,Compton(或其分支如picom)的配置文件通常位于以下位置之一,具体取决于您的发行版和安装方式:


1. 默认配置文件路径

  • 传统路径(旧版本或手动安装):

    ~/.config/compton.conf
    

    ~/.compton.conf
    
  • Picom(Compton分支)

    ~/.config/picom.conf
    

2. 系统级配置文件

某些发行版可能将默认配置放在系统目录中(需root权限修改):

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

3. 如何生成默认配置

如果配置文件不存在,可以通过以下命令生成一个默认配置模板:

picom --example-config > ~/.config/picom.conf

或(Compton旧版):

compton --example-config > ~/.config/compton.conf

4. 指定自定义配置文件

启动时通过参数指定配置文件路径:

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

5. 常见发行版差异

  • Arch Linux
    通常使用picom,配置文件在 ~/.config/picom/picom.conf
  • Ubuntu/Debian
    旧版可能保留compton.conf,新版迁移到picom.conf

6. 验证配置加载

检查Compton/picom是否加载了您的配置:

picom --diagnostics

或查看日志:

tail -f ~/.cache/picom.log

提示

  • 如果找不到配置文件,可能是默认参数运行,建议手动创建。
  • 编辑后重启生效:pkill picom && picom -b

如有其他问题,请提供您的发行版和Compton/picom版本信息!