温馨提示×

Debian Compton服务如何管理

小樊
50
2025-08-20 01:48:28
栏目: 智能运维

安装Compton

  • 使用snap安装
    sudo snap install compton --classic
  • 使用apt安装
    sudo apt update && sudo apt install compton

启动与停止服务

  • 手动启动
    compton -b(后台运行)
  • 通过systemd管理
    • 启动:sudo systemctl start compton
    • 停止:sudo systemctl stop compton
    • 重启:sudo systemctl restart compton

设置开机自启

  • 启用服务
    sudo systemctl enable compton
  • 禁用服务
    sudo systemctl disable compton

配置Compton

  • 编辑配置文件(默认路径:~/.config/compton.conf):
    nano ~/.config/compton.conf
    可配置选项包括阴影、透明度、帧率等,例如:
    shadow-exclude = ["window*"](排除窗口阴影)
  • 应用配置:重启Compton或运行 compton -c ~/.config/compton.conf

查看状态与日志

  • 检查运行状态:
    systemctl status compton
  • 查看日志:
    journalctl -u compton.service

卸载Compton

  • 使用apt卸载
    sudo apt purge compton(自动删除配置文件)
  • 手动删除
    删除二进制文件和配置文件:
    sudo rm /usr/bin/compton
    rm ~/.config/compton.conf

注意:若使用Wayland会话,Compton可能无法正常工作,需切换至X11或确认兼容性。
参考来源:[1,2,3,4,5,6,7,8,9,10,11,12]

0