ubuntu

Ubuntu Compton在多显示器环境下的配置

小樊
41
2025-10-09 20:57:27
栏目: 智能运维

Installing Compton on Ubuntu
Before configuring Compton for multi-monitor setups, ensure the package is installed. Run the following commands to update your package list and install Compton:

sudo apt update
sudo apt install compton

This installs the latest version of Compton available in Ubuntu’s repositories.

Creating or Editing the Compton Configuration File
Compton’s configuration is managed via a text file typically located at ~/.config/compton.conf. If this file doesn’t exist, create it using a text editor like nano:

nano ~/.config/compton.conf

This file will store all settings for customizing Compton’s behavior, including multi-monitor support.

Configuring Multi-Monitor Support
The most critical step for multi-monitor setups is specifying which displays Compton should manage. Use the xrandr command to list all connected monitors and their names (e.g., HDMI-1, eDP-1):

xrandr

Once you have the monitor names, add the xrandr-output directive to your compton.conf file. For example, if you have two monitors connected via HDMI and DisplayPort, use:

xrandr-output HDMI-1 eDP-1;

This tells Compton to handle both displays. For advanced configurations, you can also specify per-display settings (e.g., different opacity rules for each monitor), though this requires referencing Compton’s official documentation for detailed options.

Additional Recommended Settings
To enhance performance and visual consistency across monitors, include these common settings in your compton.conf:

These settings ensure Compton runs efficiently across multiple displays.

Running Compton with the New Configuration
After saving your compton.conf file, start Compton with the following command to apply the settings:

compton -c ~/.config/compton.conf

This launches Compton in the background using your custom configuration. To verify it’s running, check the process list with ps aux | grep compton.

Setting Up Compton for Auto-Start
To ensure Compton launches automatically when you log in, add it to your desktop environment’s startup applications:

Troubleshooting Common Issues
If you encounter problems (e.g., window flickering, performance lag), try these fixes:

0
看了该问题的人还看了