Configuration Tips for Compton on CentOS
Compton is a lightweight window compositor that enhances desktop visuals (shadows, transparency, blur) and performance. Below are essential tips for installing, configuring, and optimizing Compton on CentOS systems.
Before configuring, install Compton and its dependencies. For CentOS 7/8/9:
sudo yum install epel-release -y  sudo yum install -y xorg-x11-server-Xorg mesa-libGL wget git cmake make libX11-devel libXext-devel libXrender-devel libXi-devel libXrandr-devel libXinerama-devel libXcursor-devel libXcomposite-devel libasound2-plugins  sudo yum install -y compton  git clone https://github.com/compton/compton.git cd compton mkdir build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release make -j$(nproc) sudo make install  Compton’s default config file is located at ~/.config/compton.conf (create it if it doesn’t exist). Key settings for general use:
# Backend (glx for OpenGL acceleration, xrender for compatibility) backend = "glx" # Disable shadows for better performance (or customize exclusions) shadow = false # Set window transparency (1.0 = opaque, 0.8 = 20% transparent) opacity = 0.8 # Ignore root window transparency (prevents desktop background issues) ignore_root = true # Enable vertical sync to reduce screen tearing vsync = true # Multi-monitor support (adjust for your setup) xrandr-args = "--output HDMI-1 --auto --right-of eDP-1 --output DP-1 --auto --right-of HDMI-1"  Save the file and start Compton with:
compton -c ~/.config/compton.conf  To minimize resource usage (critical for older hardware):
shadow = false) or transparency (opacity = 1.0) if not needed.backend = "glx" (requires OpenGL-compatible drivers) for faster rendering.cache-size = 1024 (in MB) to reduce memory usage.fps-limit = 60 to cap rendering at 60 FPS (prevents unnecessary CPU load).shadow-exclude = ["class_g = 'Firefox'", "title_g = 'Firefox'"] opacity-exclude = ["class_g = 'Firefox'"]  For tailored visuals or specific use cases:
blur-background = true blur-kern = "3x3box" # Faster but less smooth; "5x5gaussian" for better quality blur-strength = 5 # Adjust intensity (1-10)  screen_edge_blur = true screen_edge_blur_radius = 10  opacity-rule = [ "80:class_g = 'URxvt'", # 80% transparent for URxvt terminals "100:class_g = 'Firefox'" # Opaque for Firefox ]  compton -c ~/.config/compton.conf --log-level debug --log-file /tmp/compton.log  To run Compton automatically on login:
sudo nano /etc/systemd/system/compton.service  Add the following content (replace ~/.config/compton.conf with your path):[Unit] Description=Compton Window Compositor After=graphical.target [Service] ExecStart=/usr/bin/compton -b -c ~/.config/compton.conf Restart=on-failure User=%i [Install] WantedBy=graphical.target  sudo systemctl daemon-reload sudo systemctl enable compton.service sudo systemctl start compton.service  systemctl status compton.service  ps -e | grep compton).compton -c /path/to/config).backend = "glx").shadow = false; blur-background = false).fps-limit = 30).backend = "xrender" (less performant but more compatible).By following these tips, you can effectively configure Compton on CentOS to achieve a balance between visual appeal and system performance. Adjust settings based on your hardware and desktop environment (GNOME, KDE, Xfce, etc.) for optimal results.