在Linux系统中,Compton是一个用于实现OpenGL合成的Compositor。要在Compton中配置多显示器,请按照以下步骤操作:
首先,确保已经安装了Compton。如果尚未安装,请使用以下命令之一进行安装:
对于基于Debian的系统(如Ubuntu):
sudo apt-get install compton
对于基于Arch的系统:
sudo pacman -S compton
创建一个Compton配置文件。在终端中运行以下命令以创建一个名为compton.conf
的文件:
mkdir -p ~/.config/compton
touch ~/.config/compton/compton.conf
使用文本编辑器打开compton.conf
文件。例如,使用nano编辑器:
nano ~/.config/compton/compton.conf
在compton.conf
文件中,添加以下内容以配置多显示器设置:
# 启用多显示器支持
backend = "glx";
# 设置阴影质量
shadow-exclude = [ ".*" ];
# 设置桌面大小和位置
xrandr-output-name-0 = "eDP-1";
xrandr-output-name-0-pos = "0x0";
xrandr-output-name-1 = "HDMI-1";
xrandr-output-name-1-pos = "1920x0";
# 设置每个显示器的缩放和旋转
xrandr-output-name-0-scale = "1x1";
xrandr-output-name-0-transform = "normal";
xrandr-output-name-1-scale = "1x1";
xrandr-output-name-1-transform = "normal";
# 设置每个显示器的透明度
opacity-rule = [
"opacity=0.95 A",
"opacity=1.00 AA"
];
请注意,您需要根据您的显示器名称和分辨率更改xrandr-output-name-*
和xrandr-output-name-*-pos
值。要获取显示器名称,请运行xrandr
命令。
保存并关闭compton.conf
文件。
重新启动Compton以应用更改。您可以通过以下命令重新启动Compton:
compton -c ~/.config/compton/compton.conf
或者,您可以将Compton添加到系统启动应用程序中,以便在每次启动时自动运行。
现在,Compton应该已经配置为使用多个显示器。如果您遇到任何问题,请检查compton.conf
文件中的设置是否正确,并确保您的图形驱动程序支持OpenGL合成。