在Debian系统中配置Compton以支持多显示器,可以按照以下步骤进行:
首先,确保你的Debian系统是最新的,然后安装Compton和相关的依赖项:
sudo apt update && sudo apt upgrade -y
sudo apt install compton x11-xserver-utils wmctrl -y
在你的主目录下创建一个名为 .config/compton.conf
的文件,并添加以下内容:
backend = xrender
use_ewm = true
ignore_geometry = true
你可以根据需要进行修改,例如启用边缘窗口管理器(Edge Window Manager)功能。
在 /etc/init.d/
目录下创建一个名为 compton
的文件,并添加以下内容:
#!/bin/sh
### BEGIN INIT INFO
# Provides: compton
# Required-Start: local_fs remote_fs network syslog named time uids groups
# Required-Stop: local_fs remote_fs network syslog named time uids groups
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Compton window manager
### END INIT INFO
case "$1" in
start)
compton --config ~/.config/compton.conf &
;;
stop)
pkill compton
;;
restart)
pkill compton
compton --config ~/.config/compton.conf &
;;
*)
echo "Usage: /etc/init.d/compton {start|stop|restart}"
exit 1
;;
esac
exit 0
然后,给予这个脚本执行权限:
sudo chmod +x /etc/init.d/compton
使用 systemctl
命令启用并启动Compton服务:
sudo systemctl enable compton
sudo systemctl start compton
如果你使用的是Openbox作为显示管理器,你可能还需要配置Openbox以与Compton一起工作。编辑Openbox的配置文件(通常位于 ~/.config/openbox/lxde-rc.xml
或 ~/.config/openbox/lubuntu-rc.xml
),并添加以下内容:
<application class="*">
<decor ignore name="Compton"/>
</application>
对于喜欢使用命令行的用户,xrandr
是一个非常强大的工具。以下是一些基本的 xrandr
命令示例:
xrandr
xrandr --output VGA-0 --same-as LVDS-0 --auto
xrandr --output VGA-0 --mode 1280x1024
xrandr --output VGA-0 --right-of LVDS-0 --auto
xrandr --output VGA-0 --off
打开一个窗口并移动它,看看Compton是否正常工作。如果一切正常,你应该会看到窗口的阴影和边缘效果。如果遇到问题,如鼠标无法跨屏或窗口布局不正确,可以返回显示设置进行调整。
请注意,Compton的配置选项和步骤可能会随着版本的更新而发生变化。建议查阅最新的Compton文档或社区资源以获取最新的配置指南。