温馨提示×

ubuntu compton如何实现窗口抖动

小樊
41
2025-10-18 09:55:53
栏目: 智能运维

Compton 是一个用于 OpenGL 合成的 Compositor,它可以提高桌面环境的视觉效果

首先,确保你已经安装了 Compton。在 Ubuntu 上,你可以使用以下命令安装:

sudo apt-get install compton

接下来,创建一个名为 compton.conf 的配置文件,以便自定义 Compton 的行为。你可以使用文本编辑器创建一个新文件,例如:

nano ~/.compton.conf

compton.conf 文件中,添加以下内容以实现窗口抖动效果:

backend = "glx";
shadow-exclude = [ ".*" ];
glx-no-stencil = true;
glx-smooth = false;
glx-rotate = "none";
glx-scale = false;

保存并关闭文件。

现在,你需要创建一个 systemd 服务文件,以便在系统启动时自动运行 Compton。创建一个名为 compton.service 的新文件:

sudo nano /etc/systemd/system/compton.service

compton.service 文件中,添加以下内容:

[Unit]
Description=Compton Compositor
After=display-manager.service

[Service]
ExecStart=/usr/bin/compton -c ~/.compton.conf
Restart=always
User=nobody
Group=nogroup

[Install]
WantedBy=multi-user.target

保存并关闭文件。

接下来,启用并启动 Compton 服务:

sudo systemctl enable compton.service
sudo systemctl start compton.service

现在,Compton 应该已经在系统启动时自动运行,并实现窗口抖动效果。如果你想要调整抖动效果的参数,可以在 compton.conf 文件中进行修改。更多关于 Compton 配置选项的信息,请参考官方文档:https://github.com/aarch64-computer/compton/wiki/Configuration

0