温馨提示×

debian compton怎么启动

小樊
45
2026-09-05 00:58:49
栏目: 智能运维

在 Debian 上启动 Compton(现在多数发行版已改名为 Picom,但命令和配置基本兼容),一般步骤如下:


一、安装 Compton / Picom

如果你用较老版本 Debian(带 compton 包):

sudo apt update
sudo apt install compton

如果你用新版本 Debian(推荐 picom):

sudo apt update
sudo apt install picom

二、创建配置文件(可选但推荐)

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

示例配置:

backend = "glx";
vsync = true;
shadow = true;
fade = true;

如果用的是 picom,把路径改成 ~/.config/picom/picom.conf


三、手动启动 Compton

Compton:

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

Picom:

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

想后台运行,加 -b

compton -b
# 或
picom -b

四、开机自动启动(重要)

方法 1:用桌面环境自启(推荐)

  • GNOME / KDE / XFCE
    设置 → 开机启动 → 添加命令:
    compton -b
    
    picom -b
    

方法 2:.xinitrc(用 startx 的用户)

编辑 ~/.xinitrc

compton -b &
exec dwm

方法 3:Systemd 用户服务(高级)

systemctl --user enable --now compton

(取决于是否提供了 service 文件)


五、常见问题

  • 黑屏 / 无透明效果
    确认你用的是 X11,不是 Wayland
  • Compton 已停止维护
    新项目叫 picom,功能更全

如果你告诉我:

  • Debian 版本
  • 桌面环境(GNOME / KDE / XFCE / i3 等)

我可以给你更精确的启动方式。

0