centos

CentOS Compton如何启用垂直同步

小樊
38
2025-11-30 00:07:29
栏目: 智能运维

启用垂直同步的步骤

操作步骤

  1. 安装 compton(如未安装)
    centos 7:sudo yum install compton;centos 8+/stream:sudo dnf install compton。

  2. 创建或编辑配置文件
    配置文件路径:~/.config/compton.conf(若不存在则创建):
    mkdir -p ~/.config
    nano ~/.config/compton.conf。

  3. 写入启用 vsync 的配置
    示例(使用 glx 后端并开启 vsync):
    backend = “glx”
    vsync = true
    说明:backend 可选 “glx” 或 “xrender”,一般 glx 在支持 opengl 的显卡上更合适;vsync 设置为 true 即可开启垂直同步。

  4. 使配置生效
    方式一(会话内重启):killall compton && compton &
    方式二(开机自启,可选):创建 systemd 服务 /etc/systemd/system/compton.service,内容示例:
    [unit]
    description=compton window composer
    after=display-manager.service
    [service]
    type=simple
    execstart=/usr/bin/compton --config ~/.config/compton.conf
    restart=on-failure
    [install]
    wantedby=multi-user.target
    然后执行:sudo systemctl daemon-reload && sudo systemctl enable --now compton.service。

验证与常见问题

0
看了该问题的人还看了