From 2bcfa3df1a1b9d9ee78e8c01b09a9826e8de74eb Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 2 Feb 2026 13:21:24 -0800 Subject: [PATCH] picom: use spring physics for open/close animations - Scale: spring with bounce (clamping=false) for a "pop" effect - Opacity: spring with clamping=true to prevent going above 1 or below 0 - Close uses clamping=true on scale to avoid bounce when closing Co-Authored-By: Claude Opus 4.5 --- nixos/xmonad.nix | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nixos/xmonad.nix b/nixos/xmonad.nix index e53a9106..913c4ee1 100644 --- a/nixos/xmonad.nix +++ b/nixos/xmonad.nix @@ -156,45 +156,42 @@ makeEnable config "myModules.xmonad" true { end = 1; }; }, - # Opacity fade animation + # Window open/show animation with spring physics { triggers = ["open", "show"]; + # Opacity uses spring with clamping to prevent going above 1 opacity = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; + curve = "spring(150, 18, 1.5, true)"; start = 0; end = "window-raw-opacity"; }; + # Scale uses spring with bounce for a nice "pop" effect scale-x = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; - start = 0.9; + curve = "spring(150, 18, 1.5, false)"; + start = 0.85; end = 1; }; scale-y = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; - start = 0.9; + curve = "spring(150, 18, 1.5, false)"; + start = 0.85; end = 1; }; }, + # Window close/hide animation with spring physics { triggers = ["close", "hide"]; opacity = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; + curve = "spring(150, 18, 1.5, true)"; start = "window-raw-opacity"; end = 0; }; scale-x = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; + curve = "spring(150, 18, 1.5, true)"; start = 1; end = 0.9; }; scale-y = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; + curve = "spring(150, 18, 1.5, true)"; start = 1; end = 0.9; };