From 4b56e3c49449e8e4e0e520fe02609349a2051a1a Mon Sep 17 00:00:00 2001 From: doryan Date: Sun, 3 Nov 2024 18:13:37 +0400 Subject: [PATCH] feat(animation): add animation on geometry change --- picom/picom.conf | 92 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 76 insertions(+), 16 deletions(-) diff --git a/picom/picom.conf b/picom/picom.conf index e61459e..26262eb 100644 --- a/picom/picom.conf +++ b/picom/picom.conf @@ -120,7 +120,7 @@ fade-delta = 10 # 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 = 5; +corner-radius = 0; # Exclude conditions for rounded corners. #rounded-corners-exclude = [ @@ -142,16 +142,17 @@ corner-radius = 5; # 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 = false; + +dithered-present = true; +vsync = true; + +detect-rounded-corners = true; detect-client-opacity = true; detect-transient = true; -detect-client-leader = true -glx-no-stencil = true -glx-no-rebind-pixmap = false + use-damage = true; -xrender-sync-fence = false -log-level = "warn"; rules = ({ match = "WM_TRANSIENT_FOR@"; @@ -192,7 +193,7 @@ rules = ({ blur-opacity = 0; shadow-opacity = "opacity"; scale-y = { - curve = "cubic-bezier(0.21, 0.02, 0.76, 0.36)"; + curve = "cubic-bezier(0.25, 0.05, 0.28, 1)"; duration = 0.15; start = 1; end = 0.7; @@ -240,7 +241,7 @@ rules = ({ blur-opacity = 0; shadow-opacity = "opacity"; scale-y = { - curve = "cubic-bezier(0.21, 0.02, 0.76, 0.36)"; + curve = "cubic-bezier(0.25, 0.05, 0.28, 1)"; duration = 0.15; start = 1; end = 0.7; @@ -305,7 +306,7 @@ animations = ({ offset-x = "(1 - scale-x) / 2 * window-width"; offset-y = "(1 - scale-y) / 2 * window-height"; scale-x = { - curve = "cubic-bezier(0.21, 0.02, 0.76, 0.36)"; + curve = "cubic-bezier(0.25, 0.05, 0.28, 1)"; duration = 0.15; start = 1; end = 0.9; @@ -350,13 +351,13 @@ animations = ({ { triggers = ["workspace-out"]; offset-y = { - curve = "cubic-bezier(0.21, 0.02, 0.76, 0.36)"; + 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.21, 0.02, 0.76, 0.36)"; + curve = "cubic-bezier(0.25, 0.05, 0.28, 1)"; duration = 0.10; start = "0"; end = "- window-height / 2"; @@ -374,7 +375,7 @@ animations = ({ }, { triggers = ["workspace-out-inverse"]; offset-y = { - curve = "cubic-bezier(0.21, 0.02, 0.76, 0.36)"; + curve = "cubic-bezier(0.25, 0.05, 0.28, 1)"; duration = 0.15; start = "0"; end = "window-height / 2"; @@ -434,13 +435,72 @@ animations = ({ 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.21, 0.02, 0.76, 0.36)"; +# timing = "0.15s cubic-bezier(0.25, 0.05, 0.28, 1)"; # start = "0"; # end = "-window-monitor-height"; # }; @@ -455,7 +515,7 @@ animations = ({ #}, { # triggers = ["workspace-out-inverse"]; # offset-y = { -# timing = "0.15s cubic-bezier(0.21, 0.02, 0.76, 0.36)"; +# timing = "0.15s cubic-bezier(0.25, 0.05, 0.28, 1)"; # start = "0"; # end = "window-monitor-height"; # };