Installing Compton on Ubuntu
Before configuring multi-monitor settings, ensure Compton is installed. Run the following commands in the terminal 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 file is typically located at ~/.config/compton.conf
. If this directory or file doesn’t exist, create it manually:
mkdir -p ~/.config nano ~/.config/compton.conf
Use a text editor (like nano
or vim
) to add or modify configuration options. This file stores all settings for Compton’s behavior, including multi-monitor adjustments.
Configuring Multi-Monitor Support
To enable multi-monitor functionality, you need to specify which displays Compton should manage and use a compatible backend. Add the following lines to your compton.conf
file:
glx
backend for hardware acceleration (recommended for multi-monitor setups):backend "glx";
xrandr
in the terminal to get your monitor names (e.g., HDMI-1
, eDP-1
). Then, add the output
parameter to your config:output = "HDMI-1 eDP-1"; # Replace with your actual monitor names
This tells Compton to manage both the external (HDMI-1
) and internal (eDP-1
) displays.Additional Recommended Settings
For better performance and aesthetics, include these optional configurations in your compton.conf
:
opacity-rule = [ "class_g \"Desktop\" A", "class_g \"Gnome-terminal\" A", "class_g \"Firefox\" A" ];
shadow-exclude = [ "class_g \"Desktop\"", "class_g \"Gnome-terminal\"", "class_g \"Firefox\"" ];
fps-limit = 60;
These settings improve compatibility and performance for multi-monitor setups.
Running Compton with Your Configuration
After saving changes to compton.conf
, test the configuration by running:
compton -c ~/.config/compton.conf
The -c
flag tells Compton to use your custom config file. If everything works as expected, you’ll see window effects applied across all monitors.
Setting Up Compton for Auto-Start
To ensure Compton launches automatically when you log in, add it to your system’s startup applications:
compton -b -c ~/.config/compton.conf
The -b
flag runs Compton in the background.Troubleshooting Common Issues
xrandr
, verify physical connections and try reconnecting the cable.fps-limit
or disable hardware acceleration (set backend "xrender"
) if you experience lag.glx-vsync true
in your config file.By following these steps, you can configure Compton to support multi-monitor setups on Ubuntu, enabling hardware-accelerated window effects across all displays.