diff --git a/nixos/xmonad.nix b/nixos/xmonad.nix index cbfaef95..17405a11 100644 --- a/nixos/xmonad.nix +++ b/nixos/xmonad.nix @@ -98,68 +98,8 @@ makeEnable config "myModules.xmonad" true { backend = "glx"; settings = { - # Spring physics animations (mainline picom with spring-physics branch) - # Syntax: spring(stiffness, dampening, mass) or spring(stiffness, dampening, mass, clamping) - # Set clamping to false for bounce/overshoot effects - animations = [ - # Window move/resize animation with spring physics - { - triggers = ["geometry"]; - offset-x = { - curve = "spring(250, 20, 1, false)"; - start = "window-x-before - window-x"; - end = 0; - }; - offset-y = { - curve = "spring(250, 20, 1, false)"; - start = "window-y-before - window-y"; - end = 0; - }; - } - # Opacity fade animation - { - triggers = ["open" "show"]; - opacity = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; - start = 0; - end = "window-raw-opacity"; - }; - scale-x = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; - start = 0.9; - end = 1; - }; - scale-y = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; - start = 0.9; - end = 1; - }; - } - { - triggers = ["close" "hide"]; - opacity = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; - start = "window-raw-opacity"; - end = 0; - }; - scale-x = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; - start = 1; - end = 0.9; - }; - scale-y = { - curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; - duration = 0.2; - start = 1; - end = 0.9; - }; - } - ]; + # Note: animations must use () not [] in libconfig, so we put them in extraArgs + # via xdg.configFile below fade-in-step = 0.028; fade-out-step = 0.028; @@ -198,6 +138,78 @@ makeEnable config "myModules.xmonad" true { }; }; + # Spring physics animations config - written separately because home-manager + # generates [] (arrays) but picom needs () (lists) for animations + xdg.configFile."picom/animations.conf".text = '' + # Spring physics animations (mainline picom with spring-physics branch) + # Syntax: spring(stiffness, dampening, mass) or spring(stiffness, dampening, mass, clamping) + # Set clamping to false for bounce/overshoot effects + animations = ( + # Window move/resize animation with spring physics + { + triggers = ["geometry"]; + offset-x = { + curve = "spring(250, 20, 1, false)"; + start = "window-x-before - window-x"; + end = 0; + }; + offset-y = { + curve = "spring(250, 20, 1, false)"; + start = "window-y-before - window-y"; + end = 0; + }; + }, + # Opacity fade animation + { + triggers = ["open", "show"]; + opacity = { + curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; + duration = 0.2; + start = 0; + end = "window-raw-opacity"; + }; + scale-x = { + curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; + duration = 0.2; + start = 0.9; + end = 1; + }; + scale-y = { + curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; + duration = 0.2; + start = 0.9; + end = 1; + }; + }, + { + triggers = ["close", "hide"]; + opacity = { + curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; + duration = 0.2; + start = "window-raw-opacity"; + end = 0; + }; + scale-x = { + curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; + duration = 0.2; + start = 1; + end = 0.9; + }; + scale-y = { + curve = "cubic-bezier(0.25, 0.1, 0.25, 1)"; + duration = 0.2; + start = 1; + end = 0.9; + }; + } + ); + ''; + + # Override picom service to include animations config + systemd.user.services.picom = { + Service.ExecStart = pkgs.lib.mkForce "${pkgs.picom}/bin/picom --config \${XDG_CONFIG_HOME}/picom/picom.conf --config \${XDG_CONFIG_HOME}/picom/animations.conf"; + }; + # systemd.user.services.notifications-tray-icon = { # Unit = { # Description = "Notifications tray icon";