diff --git a/nixos/overlay.nix b/nixos/overlay.nix index f6ba74f0..a3f12bc3 100644 --- a/nixos/overlay.nix +++ b/nixos/overlay.nix @@ -168,15 +168,16 @@ in }; }); - # Using mainline picom with spring physics animation support - # Branch: spring-physics on colonelpanic8/picom + # Using mainline picom with spring physics + animation fixes + # Branch: my-picom on colonelpanic8/picom + # Includes: spring physics curve, adaptive settling threshold, position detection fix picom = prev.picom.overrideAttrs (old: { version = "13"; src = prev.fetchFromGitHub { repo = "picom"; owner = "colonelpanic8"; - rev = "spring-physics"; - sha256 = "sha256-yyUs8E8K59b1tJkJ0sdTh2hi83Uhw6fIYvBWPx0jEIw="; + rev = "my-picom"; + sha256 = "sha256-XeciIK5q6WE9wirWEHdevfGiNzRANudFcRcRhouWTFE="; }; doCheck = false; dontCheck = true; diff --git a/nixos/xmonad.nix b/nixos/xmonad.nix index 913c4ee1..a1d7f8f5 100644 --- a/nixos/xmonad.nix +++ b/nixos/xmonad.nix @@ -131,10 +131,11 @@ makeEnable config "myModules.xmonad" true { # Set clamping to false for bounce/overshoot effects animations = ( # Window move/resize animation with spring physics - # Note: "geometry" is alias for "size" + "position" triggers - # position_changed is FALSE if size also changed, so we need scale-x/y too + # "geometry" is alias for "size" + "position" triggers + # Suppress opacity changes so they don't interrupt geometry animations { triggers = ["geometry"]; + suppressions = ["decrease-opacity", "increase-opacity"]; offset-x = { curve = "spring(150, 18, 1.5, false)"; start = "window-x-before - window-x"; @@ -176,6 +177,9 @@ makeEnable config "myModules.xmonad" true { start = 0.85; end = 1; }; + # Center the scaling effect + offset-x = "(1 - scale-x) / 2 * window-width"; + offset-y = "(1 - scale-y) / 2 * window-height"; }, # Window close/hide animation with spring physics { @@ -195,6 +199,9 @@ makeEnable config "myModules.xmonad" true { start = 1; end = 0.9; }; + # Center the scaling effect + offset-x = "(1 - scale-x) / 2 * window-width"; + offset-y = "(1 - scale-y) / 2 * window-height"; } );