#################################
#             Shadows           #
#################################

# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# shadow = false
shadow = false;

# The blur radius for shadows, in pixels. (defaults to 12)
# shadow-radius = 12
shadow-radius = 60;

# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
# shadow-opacity = .75

# The left offset for shadows, in pixels. (defaults to -15)
# shadow-offset-x = -15
shadow-offset-x = -20;

# The top offset for shadows, in pixels. (defaults to -15)
# shadow-offset-y = -15
shadow-offset-y = -20;

# Red color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-red = 0

# Green color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-green = 0

# Blue color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-blue = 0

# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue)
# shadow-color = "#000000"

# Specify a list of conditions of windows that should have no shadow.
#
# examples:
#   shadow-exclude = "n:e:Notification";
#
# shadow-exclude = []
# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window.
# clip-shadow-above = []

# Specify a X geometry that describes the region in which shadow should not
# be painted in, such as a dock window region. Use
#    shadow-exclude-reg = "x10+0+0"
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
#
# shadow-exclude-reg = ""

# Crop shadow of a window fully on a particular monitor to that monitor. This is
# currently implemented using the X RandR extension.
# crop-shadow-to-monitor = false


#################################
#           Fading              #
#################################


# Fade windows in/out when opening/closing and when opacity changes,
#  unless no-fading-openclose is used.
fading = true;

# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
# fade-in-step = 0.028
fade-in-step = 0.028;

# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
# fade-out-step = 0.03
fade-out-step = 0.03;

# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
fade-delta = 10

# Specify a list of conditions of windows that should not be faded.
# fade-exclude = []

# Do not fade on window open/close.
# no-fading-openclose = false

# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
# no-fading-destroyed-argb = false


#################################
#   Transparency / Opacity      #
#################################


# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1

# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0

# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows.
# inactive-opacity-override = true

# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
# active-opacity = 1.0

# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
# inactive-dim = 0.0

# Specify a list of conditions of windows that should never be considered focused.
# focus-exclude = []

# Use fixed inactive dim value, instead of adjusting according to window opacity.
# inactive-dim-fixed = 1.0

#################################
#           Corners             #
#################################

# Sets the radius of rounded window corners. When > 0, the compositor will
# round the corners of windows. Does not interact well with
# `transparent-clipping`.
corner-radius = 2;

# Exclude conditions for rounded corners.
#rounded-corners-exclude = [
#  "window_type = 'dock'",
#  "window_type = 'desktop'"
#];

# Exclude conditions for background blur.
# blur-background-exclude = []


#################################
#       General Settings        #
#################################

# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false

# Specify the backend to use: `xrender`, `glx`, `egl` or `xr_glx_hybrid`.
# `xrender` is the default one.
#
# Available backends "xrender" "glx" "egl"
backend = "glx"

dithered-present = true;
vsync = true;

detect-rounded-corners = true;
detect-client-opacity = true;
detect-transient = true;

use-damage = true;

rules = ({
    match = "WM_TRANSIENT_FOR@";
    animations = ({
        triggers = ["open", "show"];
        opacity = {
            curve = "linear";
            duration = 0.15;
            start = "window-raw-opacity-before";
            end = "window-raw-opacity";
        };
        blur-opacity = {
            curve = "linear";
            duration = 0.1;
            delay = 0.15;
            start = "window-raw-opacity-before";
            end = "window-raw-opacity";
        };
        shadow-opacity = "opacity";
        scale-y = {
            curve = "cubic-bezier(0.24, 0.64, 0.79, 0.98)";
            duration = 0.15;
            start = 0.8;
            end = 1;
        };
        offset-y = "(-window-height/2) + (window-height/2) * scale-y";
        shadow-scale-y = "scale-y";
        shadow-offset-y = "offset-y";
        saved-image-blend = 0;
    },{
        triggers = ["close", "hide"];
        opacity = {
            curve = "linear";
            duration = 0.15;
            start = "window-raw-opacity-before";
            end = "0";
        };
        blur-opacity = 0;
        shadow-opacity = "opacity";
        scale-y = {
            curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
            duration = 0.15;
            start = 1;
            end = 0.7;
        };
        offset-y = "(-window-height/2) + (window-height/2) * scale-y";
        shadow-scale-y = "scale-y";
        shadow-offset-y = "offset-y";
        saved-image-blend = 0;
    });
}, {
    match = "window_type = 'dropdown_menu' || window_type = 'popup_menu' || window_type = 'menu'";
    animations = ({
        triggers = ["open", "show"];
        opacity = {
            curve = "linear";
            duration = 0.15;
            start = "window-raw-opacity-before";
            end = "window-raw-opacity";
        };
        blur-opacity = {
            curve = "linear";
            duration = 0.1;
            delay = 0.15;
            start = "window-raw-opacity-before";
            end = "window-raw-opacity";
        };
        shadow-opacity = "opacity";
        scale-y = {
            curve = "cubic-bezier(0.24, 0.64, 0.79, 0.98)";
            duration = 0.15;
            start = 0.8;
            end = 1;
        };
        shadow-scale-y = "scale-y";
        saved-image-blend = 0;

    },{
        triggers = ["close", "hide"];
        opacity = {
            curve = "linear";
            duration = 0.15;
            start = "window-raw-opacity-before";
            end = "0";
        };
        blur-opacity = 0;
        shadow-opacity = "opacity";
        scale-y = {
            curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
            duration = 0.15;
            start = 1;
            end = 0.7;
        };
        shadow-scale-y = "scale-y";
        saved-image-blend = 0;

    });
}, {
    match = "window_type = 'dropdown_menu' || window_type = 'popup_menu' || window_type = 'menu'";
    opacity = 0.9;
}, {
    match = "window_type = 'dock' || window_type = 'desktop'";
    blur-background = false;
    corner-radius = 0;
}, {
    match = "class_g *= 'i3lock' || _NET_WM_STATE@[1] = '_NET_WM_STATE_FULLSCREEN' || _NET_WM_STATE@[2] = '_NET_WM_STATE_FULLSCREEN' || _NET_WM_STATE@[3] = '_NET_WM_STATE_FULLSCREEN' || _NET_WM_STATE@[4] = '_NET_WM_STATE_FULLSCREEN'";
    shadow = false;
    corner-radius = 0;
    animations = ({
        triggers = ["open", "show"];
        opacity = {
            curve = "linear";
            duration = 0.15;
            start = "window-raw-opacity-before";
            end = "window-raw-opacity";
        };
        blur-opacity = {
            curve = "linear";
            duration = 0.1;
            delay = 0.15;
            start = "window-raw-opacity-before";
            end = "window-raw-opacity";
        };
        shadow-opacity = "opacity";
        saved-image-blend = 0;

    },{
        triggers = ["close", "hide"];
        opacity = {
            curve = "linear";
            duration = 0.15;
            start = "window-raw-opacity-before";
            end = "0";
        }
        blur-opacity = 0;
        shadow-opacity = "opacity";
        saved-image-blend = 0;
    });
});

animations = ({
    triggers = ["close", "hide"];
    opacity = {
        curve = "linear";
        duration = 0.15;
        start = "window-raw-opacity-before";
        end = "window-raw-opacity";
    };
    blur-opacity = "0";
    shadow-opacity = "opacity";
    offset-x = "(1 - scale-x) / 2 * window-width";
    offset-y = "(1 - scale-y) / 2 * window-height";
    scale-x = {
        curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
        duration = 0.15;
        start = 1;
        end = 0.9;
    };
    scale-y = "scale-x";
    shadow-scale-x = "scale-x";
    shadow-scale-y = "scale-y";
    shadow-offset-x = "offset-x";
    shadow-offset-y = "offset-y";
}, {
    triggers = ["open", "show"];
    opacity = {
        curve = "linear";
        duration = 0.15;
        start = "window-raw-opacity-before";
        end = "window-raw-opacity";
    };
    blur-opacity = {
        curve = "linear";
        duration = 0.1;
        delay = 0.15;
        start = "window-raw-opacity-before";
        end = "window-raw-opacity";
    };
    shadow-opacity = "opacity";
    offset-x = "(1 - scale-x) / 2 * window-width";
    offset-y = "(1 - scale-y) / 2 * window-height";
    scale-x = {
        curve = "cubic-bezier(0.24, 0.64, 0.79, 0.98)";
        duration = 0.15;
        start = 0.95;
        end = 1;
    };
    scale-y = "scale-x";
    shadow-scale-x = "scale-x";
    shadow-scale-y = "scale-y";
    shadow-offset-x = "offset-x";
    shadow-offset-y = "offset-y";
},

# Half Window Size Desktop Switch
{
    triggers = ["workspace-out"];
    offset-y = {
        curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
        duration = 0.15;
        start = "0";
        end = "- window-height / 2";
    };
    scale-x = {
      curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
      duration = 0.10;
      start = "0";
      end = "- window-height / 2";

    }
    shadow-offset-y = "offset-y";
    opacity = {
        curve = "linear";
        duration = 0.15;
        start = "window-raw-opacity-before";
        end = "window-raw-opacity";
    };
    blur-opacity = "0";
    shadow-opacity = "opacity";
}, {
    triggers = ["workspace-out-inverse"];
    offset-y = {
        curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
        duration = 0.15;
        start = "0";
        end = "window-height / 2";
    };
    shadow-offset-y = "offset-y";
    opacity = {
        curve = "linear";
        duration = 0.15;
        start = "window-raw-opacity-before";
        end = "window-raw-opacity";
    };
    blur-opacity = "0";
    shadow-opacity = "opacity";
}, {
    triggers = ["workspace-in"];
    offset-y = {
        curve = "cubic-bezier(0.24, 0.64, 0.79, 0.98)";
        duration = 0.15;
        start = "window-height / 2";
        end = "0";
    };
    shadow-offset-y = "offset-y";
    opacity = {
        curve = "linear";
        duration = 0.15;
        start = "0";
        end = "window-raw-opacity";
    };
    blur-opacity = {
        curve = "linear";
        duration = 0.1;
        delay = 0.15;
        start = "0";
        end = "window-raw-opacity";
    };
    shadow-opacity = "opacity";
}, {
    triggers = ["workspace-in-inverse"];
    offset-y = {
        curve = "cubic-bezier(0.24, 0.64, 0.79, 0.98)";
        duration = 0.15;
        start = "- window-height / 2";
        end = "0";
    };
    shadow-offset-y = "offset-y";
    opacity = {
        curve = "linear";
        duration = 0.15;
        start = "0";
        end = "window-raw-opacity";
    };
    blur-opacity = {
        curve = "linear";
        duration = 0.1;
        delay = 0.15;
        start = "0";
        end = "window-raw-opacity";
    };
    shadow-opacity = "opacity";
},{
    triggers = ["geometry"]
    scale-x = {
      curve = "cubic-bezier(0.16, 1, 0.3, 1)";
      duration = 0.2;
      start = "window-width-before / window-width";
      end = 1;
    }
    scale-y = {
      curve = "cubic-bezier(0.16, 1, 0.3, 1)";
      duration = 0.2;
      start = "window-height-before / window-height";
      end = 1;
    }
    offset-x = {
      curve = "cubic-bezier(0.16, 1, 0.3, 1)";
      duration = 0.2;
      start = "window-x-before - window-x";
      end = 0;
    }
    offset-y = {
      curve = "cubic-bezier(0.16, 1, 0.3, 1)";
      duration = 0.2;
      start = "window-y-before - window-y";
      end = 0;
    }
    
    saved-image-blend = 0; 
    shadow-scale-x = "scale-x";
    shadow-scale-y = "scale-y";
    shadow-offset-x = "offset-x";
    shadow-offset-y = "offset-y";
  }

# {
#     triggers = [ "geometry" ];
#     scale-x = {
#       curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
#       duration = 0.25;
#       start = "window-width-before / window-width";
#       end = 1;
#     }
#     scale-y = {
#       curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
#       duration = 0.25;
#       start = "window-height-before / window-height";
#       end = 1;
#     }
#     offset-x = {
#       curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
#       duration = 0.25;
#       start = "window-x-before - window-x";
#       end = "0";
#     }
#     offset-y = {
#       curve = "cubic-bezier(0.25, 0.05, 0.28, 1)";
#       duration = 0.25;
#       start = "window-y-before - window-y";
#       end = "0";
#     }
# }
# Full Opaque Desktop Switch
#{
#    triggers = ["workspace-out"];
#    offset-y = {
#        timing = "0.15s cubic-bezier(0.25, 0.05, 0.28, 1)";
#        start = "0";
#        end = "-window-monitor-height";
#    };
#    shadow-offset-y = "offset-y";
#    opacity = {
#        timing = "0.2s linear";
#        start = "window-raw-opacity-before";
#        end = "window-raw-opacity-before";
#    };
#    blur-opacity = "opacity";
#    shadow-opacity = "opacity";
#}, {
#    triggers = ["workspace-out-inverse"];
#    offset-y = {
#        timing = "0.15s cubic-bezier(0.25, 0.05, 0.28, 1)";
#        start = "0";
#        end = "window-monitor-height";
#    };
#    shadow-offset-y = "offset-y";
#    opacity = {
#        timing = "0.2s linear";
#        start = "window-raw-opacity-before";
#        end = "window-raw-opacity-before";
#    };
#    blur-opacity = "opacity";
#    shadow-opacity = "opacity";
#}, {
#    triggers = ["workspace-in"];
#    offset-y = {
#        timing = "0.15s cubic-bezier(0.24, 0.64, 0.79, 0.98)";
#        start = "window-monitor-height";
#        end = "0";
#    };
#    shadow-offset-y = "offset-y";
#    opacity = {
#        timing = "0.2s linear";
#        start = "window-raw-opacity";
#        end = "window-raw-opacity";
#    };
#    blur-opacity = "opacity";
#    shadow-opacity = "opacity";
#}, {
#    triggers = ["workspace-in-inverse"];
#    offset-y = {
#        timing = "0.15s cubic-bezier(0.24, 0.64, 0.79, 0.98)";
#        start = "-window-monitor-height";
#        end = "0";
#    };
#    shadow-offset-y = "offset-y";
#    opacity = {
#        timing = "0.2s linear";
#        start = "window-raw-opacity";
#        end = "window-raw-opacity";
#    };
#    blur-opacity = "opacity";
#    shadow-opacity = "opacity";
#}

)