温馨提示×

debian compton支持哪些配置

小樊
42
2026-10-01 22:51:32
栏目: 智能运维

在 Debian 上使用的 Compton(现在更多被称为 Picom,Compton 的活跃分支)是一个轻量级的 X11 合成管理器,常用于实现窗口透明、阴影、模糊等特效。

下面按常见配置类别说明 Compton / Picom 支持的主要配置项(适用于 Debian 及大多数 Linux 发行版)。


一、基本运行配置

通常配置文件位于:

~/.config/compton.conf
# 或
~/.config/picom.conf

常见启动参数(命令行):

compton -b          # 后台运行
compton --config ~/.config/compton.conf

二、窗口透明度(Opacity)

opacity-rule = [
  "80:class_g = 'URxvt'",
  "90:class_g = 'Firefox'"
];

全局透明:

inactive-opacity = 0.8;
active-opacity = 1.0;

三、阴影(Shadow)

shadow = true;
shadow-radius = 12;
shadow-offset-x = -2;
shadow-offset-y = -2;
shadow-opacity = 0.5;

排除某些窗口:

shadow-exclude = [
  "class_g = 'Dmenu'",
  "name = 'Notification'"
];

四、模糊(Blur,Picom 支持更好)

blur-method = "gaussian";
blur-size = 10;
blur-strength = 5;

背景模糊:

blur-background = true;
blur-background-frame = true;

五、淡入淡出(Fade)

fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-delta = 5;

六、刷新率与性能

vsync = true;
refresh-rate = 60;

后端选择:

backend = "glx";   # 或 xrender

七、窗口规则(Window Rules)

focus-exclude = "class_g = 'Conky'";
unredir-if-possible = true;

避免全屏游戏卡顿:

unredir-if-possible = true;

八、DPR / HiDPI(部分 Picom 版本)

mark-wmwin-focused = true;
mark-ovredir-focused = true;

九、Debian 使用建议

  1. Debian 默认仓库

    sudo apt install compton
    

    或使用更现代的:

    sudo apt install picom
    
  2. i3 / Openbox 用户常用

    • 在 ~/.xinitrc 或窗口管理器配置中自启
    picom --config ~/.config/picom.conf &
    
  3. Wayland 不支持

    • Compton / Picom 仅支持 X11

十、示例最小配置

backend = "glx";
vsync = true;
shadow = true;
shadow-radius = 8;
fading = true;
inactive-opacity = 0.9;

如果你愿意,我可以:

  • 给你一份 Debian + i3 / Openbox 的完整 compton.conf
  • 或根据你的 **显卡(Intel / NVIDIA / AMD)**优化配置

0 踩