{ config, lib, ... }: let animationSpeed = config.theme.animation-speed; animationDuration = if animationSpeed == "slow" then 4 else if animationSpeed == "medium" then 2.5 else 1.5; borderDuration = if animationSpeed == "slow" then 10 else if animationSpeed == "medium" then 6 else 3; bezier = points: { type = "bezier"; inherit points; }; curves = { linear = [[0 0] [1 1]]; md3_standard = [[0.2 0] [0 1]]; md3_decel = [[0.05 0.7] [0.1 1]]; md3_accel = [[0.3 0] [0.8 0.15]]; overshot = [[0.05 0.9] [0.1 1.1]]; crazyshot = [[0.1 1.5] [0.76 0.92]]; hyprnostretch = [[0.05 0.9] [0.1 1.0]]; menu_decel = [[0.1 1] [0 1]]; menu_accel = [[0.38 0.04] [1 0.07]]; easeInOutCirc = [[0.85 0] [0.15 1]]; easeOutCirc = [[0 0.55] [0.45 1]]; easeOutExpo = [[0.16 1] [0.3 1]]; softAcDecel = [[0.26 0.26] [0.15 1]]; md2 = [[0.4 0] [0.2 1]]; }; anim = leaf: speed: bezier: extra: { inherit leaf speed bezier; enabled = true; } // extra; in { wayland.windowManager.hyprland.settings = { config.animations.enabled = true; curve = lib.mapAttrsToList (name: points: {_args = [name (bezier points)];}) curves; animation = [ (anim "windows" animationDuration "md3_decel" {style = "popin 60%";}) (anim "windowsIn" animationDuration "md3_decel" {style = "popin 60%";}) (anim "windowsOut" animationDuration "md3_accel" {style = "popin 60%";}) (anim "border" borderDuration "default" {}) (anim "fade" animationDuration "md3_decel" {}) (anim "layersIn" animationDuration "menu_decel" {style = "slide";}) (anim "layersOut" animationDuration "menu_accel" {}) (anim "fadeLayersIn" animationDuration "menu_decel" {}) (anim "fadeLayersOut" animationDuration "menu_accel" {}) (anim "workspaces" animationDuration "menu_decel" {style = "slide";}) (anim "specialWorkspace" animationDuration "md3_decel" {style = "slidevert";}) ]; }; }