温馨提示×

如何给linux compton换主题

小樊
47
2026-10-09 16:45:32
栏目: 智能运维

在 Linux 上给 compton(现在很多发行版已改名 picom)“换主题”,一般有两种理解:

  1. 换窗口/界面主题(和 compton 无关,是 GTK/Qt 主题)
  2. 改 compton 的视觉风格(阴影、模糊、透明度等,通过配置文件“主题”)

下面分别说清楚。


一、如果你是想“改 compton 的视觉效果”

compton 本身没有官方主题机制,所谓“主题”通常是指:

  • 别人写好的 compton.conf
  • 包含不同阴影/模糊/透明风格

1. 找到配置文件

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

如果没有:

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

2. 常见“主题风格”示例

✅ 极简(几乎无阴影)

shadow = false
fade = false

✅ macOS 风格(明显阴影)

shadow = true
shadow-radius = 12
shadow-opacity = 0.45
shadow-offset-x = 0
shadow-offset-y = 4
shadow-color = "000000"

✅ 模糊背景(类似 Windows 11)

blur-background = true
blur-method = "kawase"
blur-strength = 8

✅ 透明窗口

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

3. 应用“主题”

修改后重启 compton:

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

或(picom):

pkill picom
picom --config ~/.config/picom.conf &

二、如果你想“换系统主题”(不是 compton)

compton 只是合成器,不管颜色。

GTK 主题

gsettings set org.gnome.desktop.interface gtk-theme "Nord"

或手动改:

~/.gtkrc-2.0
~/.config/gtk-3.0/settings.ini

Qt 主题

qt5ct

三、现成“compton 主题”资源

  • GitHub 搜:compton.conf theme
  • 推荐:
    • compton-conf(示例配置)
    • 论坛:r/unixporn(很多 dotfiles)

四、快速判断你用的是哪个

which compton picom
  • 有 picom → 用 picom.conf
  • 只有 compton → 用 compton.conf

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

  • 你用的是 哪种桌面(i3 / bspwm / KDE / XFCE)
  • 想要 什么风格(毛玻璃 / 阴影 / 极简)

我可以直接给你一份“现成主题配置”。

0 踩