Need Help Porting Animations To Lua | Animation Speed
Using https://wiki.hypr.land/Configuring/Advanced-and-Cool/Animations/ as reference.
While tedious and sometimes frustrating it's been pretty straightforward in porting all my settings from my old configuration file to the new Lua format. All except my animations.
I'll post what I had and what I translated it to but it's clear from the new documentation and the behavior I got that I'm doing it wrong. It's way too fast.
Old Animation Config:
animations {
enabled = true
# Curves | Bezier
bezier = linear, 0, 0, 1, 1
bezier = md3_standard, 0.2, 0, 0, 1
bezier = md3_decel, 0.05, 0.7, 0.1, 1
bezier = md3_accel, 0.3, 0, 0.8, 0.15
bezier = overshot, 0.05, 0.9, 0.1, 1.1
bezier = crazyshot, 0.1, 1.5, 0.76, 0.92
bezier = hyprnostretch, 0.05, 0.9, 0.1, 1.0
bezier = menu_decel, 0.2, 1, 0, 1
bezier = menu_accel, 0.38, 0.04, 1, 0.07
bezier = easeInOutCirc, 0.85, 0, 0.15, 1
bezier = easeOutCirc, 0, 0.55, 0.45, 1
bezier = easeOutExpo, 0.16, 1, 0.3, 1
bezier = softAcDecel, 0.26, 0.26, 0.15, 1
bezier = md2, 0.4, 0, 0.2, 1 # use with .2s duration
# Windows
animation = windows, 1, 3, md3_decel, popin 60%
animation = windowsIn, 1, 3, md3_decel, popin 60%
animation = windowsOut, 1, 3, md3_accel, popin 60%
animation = border, 1, 10, default
animation = fade, 1, 3, md3_decel
# animation = layers, 1, 2, md3_decel, slide
animation = layersIn, 1, 3, menu_decel, slide
animation = layersOut, 1, 1.6, menu_accel
animation = fadeLayersIn, 1, 2, menu_decel
animation = fadeLayersOut, 1, 4.5, menu_accel
animation = workspaces, 1, 7, menu_decel, slide
# animation = workspaces, 1, 2.5, softAcDecel, slide
# animation = workspaces, 1, 7, menu_decel, slidefade 15%
# animation = specialWorkspace, 1, 3, md3_decel, slidefadevert 15%
animation = specialWorkspace, 1, 3, md3_decel, slidevert
New Animation Config:
-----------------------
-- Enable Animations --
-----------------------
hl.config({ animations = { enabled = true }})
------------
-- Curves --
------------
-- ==== Curves | Bezier ====
hl.curve("linear", { type = "bezier", points = { {0, 0}, {1, 1} } })
hl.curve("md3_standard", { type = "bezier", points = { {0.2, 0}, {0, 1} } })
hl.curve("md3_decel", { type = "bezier", points = { {0.05, 0.7}, {0.1, 1} } })
hl.curve("md3_accel", { type = "bezier", points = { {0.3, 0}, {0.8, 0.15} } })
hl.curve("overshot", { type = "bezier", points = { {0.05, 0.9}, {0.1, 1.1} } })
hl.curve("crazyshot", { type = "bezier", points = { {0.1, 1.5}, {0.76, 0.92} } })
hl.curve("hyprnostretch", { type = "bezier", points = { {0.05, 0.9}, {0.1, 1.0} } })
hl.curve("menu_decel", { type = "bezier", points = { {0.2, 1}, {0, 1} } })
hl.curve("menu_accel", { type = "bezier", points = { {0.38, 0.04}, {1, 0.07} } })
hl.curve("easeInOutCirc", { type = "bezier", points = { {0.85, 0}, {0.15, 1} } })
hl.curve("easeOutCirc", { type = "bezier", points = { {0, 0.55}, {0.45, 1} } })
hl.curve("easeOutExpo", { type = "bezier", points = { {0.16, 1}, {0.3, 1} } })
hl.curve("md2", { type = "bezier", points = { {0.4, 0}, {0.2, 1} } }) -- use with .2s duration
---- ==== Default Curves ====
--hl.curve("easeOutQuint", { type = "bezier", points = { {0.23, 1}, {0.32, 1} } })
--hl.curve("easeInOutCubic", { type = "bezier", points = { {0.65, 0.05}, {0.36, 1} } })
--hl.curve("almostLinear", { type = "bezier", points = { {0.5, 0.5}, {0.75, 1} } })
--hl.curve("quick", { type = "bezier", points = { {0.15, 0}, {0.1, 1} } })
---- ==== Default springs ====
--hl.curve("easy", { type = "spring", mass = 1, stiffness = 71.2633, dampening = 15.8273644 })
----------------
-- Animations --
----------------
-- ==== Window Animations ====
hl.animation({ leaf = "windows", enabled = true, speed = 1, 3, bezier = "md3\_decel", style = "popin 60%" })
hl.animation({ leaf = "windowsIn", enabled = true, speed = 1, 3, bezier = "md3\_decel", style = "popin 60%" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 1, 3, bezier = "md3\_decel", style = "popin 60%" })
hl.animation({ leaf = "border", enabled = true, speed = 1, 10, bezier = "default" })
hl.animation({ leaf = "fade", enabled = true, speed = 1, 3, bezier = "md3\_decel" })
--hl.animation({ leaf = "layers", enabled = true, speed = 1, 2, bezier = "md3\_decel", style = "slide" })
hl.animation({ leaf = "layersIn", enabled = true, speed = 1, 3, bezier = "menu\_decel", style = "slide" })
hl.animation({ leaf = "layersOut", enabled = true, speed = 1, 1.6, bezier = "menu\_accel", style = "slide" })
hl.animation({ leaf = "fadeLayersIn", enabled = true, speed = 1, 2, bezier = "menu\_decel" })
hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 1, 4.5, bezier = "menu\_accel" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 1, 7, bezier = "menu\_decel", style = "slide" })
--hl.animation({ leaf = "workspaces", enabled = true, speed = 1, 2.5, bezier = "softAcDecel", style = "slide" })
--hl.animation({ leaf = "workspaces", enabled = true, speed = 1, 7, bezier = "menu\_decel", style = "slidefade 15%" })
--hl.animation({ leaf = "specialWorkspace", enabled = true, speed = 1, 3, bezier = "md3\_decel", style = "slidefadevert 15%" })
hl.animation({ leaf = "specialWorkspace", enabled = true, speed = 1, 3, bezier = "md3\_decel", style = "slidevert" })
---- == Default Animations ==
--hl.animation({ leaf = "global", enabled = true, speed = 10, bezier = "default" })
--hl.animation({ leaf = "border", enabled = true, speed = 5.39, bezier = "easeOutQuint" })
--hl.animation({ leaf = "windows", enabled = true, speed = 4.79, spring = "easy" })
--hl.animation({ leaf = "windowsIn", enabled = true, speed = 4.1, spring = "easy", style = "popin 87%" })
--hl.animation({ leaf = "windowsOut", enabled = true, speed = 1.49, bezier = "linear", style = "popin 87%" })
--hl.animation({ leaf = "fadeIn", enabled = true, speed = 1.73, bezier = "almostLinear" })
--hl.animation({ leaf = "fadeOut", enabled = true, speed = 1.46, bezier = "almostLinear" })
--hl.animation({ leaf = "fade", enabled = true, speed = 3.03, bezier = "quick" })
--hl.animation({ leaf = "layers", enabled = true, speed = 3.81, bezier = "easeOutQuint" })
--hl.animation({ leaf = "layersIn", enabled = true, speed = 4, bezier = "easeOutQuint", style = "fade" })
--hl.animation({ leaf = "layersOut", enabled = true, speed = 1.5, bezier = "linear", style = "fade" })
--hl.animation({ leaf = "fadeLayersIn", enabled = true, speed = 1.79, bezier = "almostLinear" })
--hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 1.39, bezier = "almostLinear" })
--hl.animation({ leaf = "workspaces", enabled = true, speed = 1.94, bezier = "almostLinear", style = "fade" })
--hl.animation({ leaf = "workspacesIn", enabled = true, speed = 1.21, bezier = "almostLinear", style = "fade" })
--hl.animation({ leaf = "workspacesOut", enabled = true, speed = 1.94, bezier = "almostLinear", style = "fade" })
--hl.animation({ leaf = "zoomFactor", enabled = true, speed = 7, bezier = "quick" })
Just keeping the defaults in case I brake something. Basically a sliding scheme instead of the default which is pretty much instant.
I'm quite sure that it's the floating point speed variable but I'm unsure how to fix it properly. I wasn't the one that made the animation scheme.
Here's a closer side-by-side example of what translating one of the animation functions looks like:
animation = windows, 1, 3, md3_decel, popin 60%
hl.animation({ leaf = "windows", enabled = true, speed = 1, 3, bezier = "md3_decel", style = "popin 60%" })
I've tried tweaking the speed every way I could think of from lower to higher, to one number to three and every which way it doesn't seem to change the actual animation speed for whatever reason.
I assumed that the two speed integers was for acceleration and deceleration but if that's not the case I don't know why it originally had two numbers. I'm almost certain I'm doing it wrong but then I'm also wondering if I'm doing it just fine and it's a bug I'm not aware of that I'm dealing with.
If anyone could help me with this that would be awesome.