温馨提示×

Debian如何禁用Compton

小樊
43
2026-08-26 08:26:23
栏目: 智能运维

在 Debian 系统中禁用 Compton(或它的常见继任者 picom,很多教程仍叫 compton)取决于你是如何启动它的。下面按常见情况分别说明。


一、先确认你用的是 compton 还是 picom

which compton
which picom

以及查看进程:

ps aux | grep -E "compton|picom"

说明:

  • Debian 12 及以后,compton 通常已被 picom 取代
  • 有些系统里 compton 只是 picom 的兼容软链接

二、临时关闭(本次会话)

如果你只是想立刻关闭:

killall compton
# 或
killall picom

⚠️ 重启后会再次启动(如果配置了自动启动)。


三、彻底禁用(不让它开机启动)

✅ 1. 禁用 systemd 用户服务(最常见)

很多桌面环境通过 systemd 启动 picom:

systemctl --user disable picom
systemctl --user stop picom

如果是 compton:

systemctl --user disable compton
systemctl --user stop compton

检查是否存在:

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

✅ 2. 删除或禁用自动启动项(~/.config/autostart)

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

如果存在:

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

或者编辑该 .desktop 文件,将:

X-GNOME-Autostart-enabled=true

改为:

X-GNOME-Autostart-enabled=false

✅ 3. 桌面环境自带的 compositor(i3 / Openbox / XFCE)

i3wm

检查 ~/.config/i3/config

exec --no-startup-id compton
# 或
exec --no-startup-id picom

✅ 注释或删除这一行,然后:

i3-msg reload

Openbox

检查:

~/.config/openbox/autostart
~/.config/openbox/rc.xml

删除或注释:

picom &
# 或
compton &

XFCE

如果你用的是 XFCE,它自带 compositor:

xfwm4 --replace &

或在设置中关闭:

设置 → 窗口管理器微调 → 合成器 → 取消勾选 启用显示合成


✅ 4. 完全卸载(不推荐,除非确定不用)

sudo apt remove picom
# 或
sudo apt remove compton

四、验证是否已禁用

重启后执行:

ps aux | grep -E "compton|picom"

没有任何相关进程即表示成功。


五、常见建议

  • 需要关闭原因

    • 游戏/视频撕裂
    • NVIDIA 驱动冲突
    • 节省资源(老机器)
  • 替代方案

    • 使用 XFCE / Mutter / KWin 自带合成器
    • 使用 picom --backend glxxrender 调整参数

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

  • Debian 版本(11 / 12)
  • 桌面环境(GNOME / KDE / XFCE / i3 / Openbox)

我可以给你精确到命令级别的方案。

0