温馨提示×

如何禁用debian compton

小樊
36
2026-10-01 22:53:30
栏目: 智能运维

在 Debian 中“禁用 compton”通常是指停止并防止 compton(或其后继者 picom)在登录时自动启动。下面按常见场景说明。


1. 先确认你用的是 compton 还是 picom

很多 Debian 新版本已用 picom 替代 compton:

which compton
which picom
  • 有 compton → 老版本
  • 有 picom → 新版本(配置/服务名可能不同)

2. 如果是“开机/登录自动启动”的(最常见)

情况 A:通过 autostart(~/.config/autostart)

ls ~/.config/autostart/ | grep -E 'compton|picom'

如果存在:

rm ~/.config/autostart/compton.desktop
# 或
rm ~/.config/autostart/picom.desktop

或编辑对应 .desktop 文件,加一行:

X-GNOME-Autostart-enabled=false

情况 B:通过 systemd --user

systemctl --user list-unit-files | grep -E 'compton|picom'

禁用:

systemctl --user disable --now compton.service
systemctl --user disable --now picom.service

情况 C:在窗口管理器配置中启动(i3 / Openbox / XFCE)

  • i3:编辑 ~/.config/i3/config
    # 删除或注释
    # exec --no-startup-id compton
    
  • Openbox:编辑 ~/.config/openbox/autostart
    # compton &
    
  • XFCE:
    设置 → 会话和启动 → 应用程序自动启动 → 取消 compton/picom

3. 立即停止运行中的 compton

pkill compton
pkill picom

4. 如果是包想彻底不用

sudo apt remove compton
# 或
sudo apt remove picom

5. 验证

ps aux | grep -E 'compton|picom'

无输出即已禁用。


如果你能告诉我:

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

我可以给你更精确的禁用命令。

0 踩