To correctly set up Compton in i3, follow these steps:

  1. Install Compton:
    sudo apt install compton
    
  2. Create a Compton configuration file:
    touch ~/.config/compton.conf
    
  3. Open the Compton configuration file in a text editor:
    nano ~/.config/compton.conf
    
  4. Add the following lines to the configuration file:
    # Basic configuration
    backend = "glx";
    vsync = "opengl-swc";
    
    # Opacity settings
    opacity-rule = [
        "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
    ];
    
    # Shadow settings
    shadow = true;
    no-dnd-shadow = true;
    no-dock-shadow = true;
    clear-shadow = true;
    shadow-radius = 7;
    shadow-offset-x = -7;
    shadow-offset-y = -7;
    shadow-opacity = 0.7;
    shadow-exclude = [
        "name = 'Notification'",
        "class_g = 'Conky'",
        "class_g = 'Cairo-clock'",
        "class_g = 'Xfce4-notifyd'",
        "class_g = 'Xfce4-power-manager'"
    ];
    
    # Fading settings
    fading = true;
    fade-delta = 4;
    fade-in-step = 0.03;
    fade-out-step = 0.03;
    fade-exclude = [
        "_NET_WM_OPACITY@:32a"
    ];
    
    # Window type settings
    wintypes:
    {
        tooltip =
        {
            shadow = false;
            fade = true;
            opacity = 0.9;
            focus = true;
        };
    };
    
  5. Save and close the file.

  6. Open your i3 configuration file:
    nano ~/.config/i3/config
    
  7. Add the following line to the i3 configuration file to enable Compton:
    exec --no-startup-id compton --config ~/.config/compton.conf
    
  8. Save and close the file.

  9. Restart i3 for the changes to take effect:
    i3-msg restart
    

Compton should now be correctly set up in i3.