Fix Lua animations that error with 'bezier or spring is required' or 'no such bezier'
Most of the record holds against v0.56.2 LuaBindingsConfigRules.cpp. hlAnimation reads only bezier or spring and otherwise errors 'bezier or spring is required'. It checks bezierExists and reports 'no such bezier'. It rejects unknown leaves with 'no such animation leaf' and requires speed greater than 0. hlCurve needs exactly two nested points, and the error strings match. hl.config reports 'unknown config key' for animations.bezier. The current wiki page uses curve = in its syntax line and three examples, as the record says. Omarchy 4.0.4-1 default/hypr/looknfeel.lua disables the workspaces leaf and defines the five named curves, and the user looknfeel.lua loads after the defaults. The fix's spring example is wrong on 0.56.2. hlCurve reads the damping coefficient from a field named 'dampening' and returns 'hl.curve("<name>"): dampening expects a number' when it is missing. It also requires mass, stiffness and dampening each to be greater than 0.5. So the record's hl.curve("bouncy", { ..., damping = 10 }), copied from the wiki, never creates the curve, and the next line then fails with 'no such spring'. Hyprland main now reads damping and falls back to dampening, so dampening works on both. Fix, cause and symptom are updated. Nothing was exercised live.
Symptom
My animation lines in Lua are rejected or ignored. The error list shows hl.animation("windows"): bezier or spring is required even though I wrote curve = "myBezier" exactly as the wiki shows, or hl.animation("windows"): no such bezier "myBezier", hl.curve("myBezier"): "points" must contain exactly 2 points, hl.curve("bouncy"): dampening expects a number, unknown config key 'animations.bezier', or hl.animation: no such animation leaf "workspace". On Omarchy 4, switching workspaces never slides no matter what I set.
Cause
Hyprland 0.55 replaced the hyprlang bezier = and animation = keywords with two functions, hl.curve(name, spec) and hl.animation(spec). They do not live under hl.config: the animations config category in 0.56 holds only enabled and workspace_wraparound, so hl.config({ animations = { bezier = ... } }) is an unknown key.
In Hyprland 0.56.2 hlAnimation (src/config/lua/bindings/LuaBindingsConfigRules.cpp) reads the curve only from a field named bezier or spring. Any other name, including curve, ends in bezier or spring is required. The wiki animations page is inconsistent here: its syntax line and its popin 80% and slide left examples use curve = "default", while its first examples use bezier =. Only bezier and spring work on 0.56.2. The named curve must already exist when hl.animation runs, so a curve defined lower in the file, or in a file loaded later, gives no such bezier. hl.curve wants the two control points as a nested table { {x0, y0}, {x1, y1} }. The flat hyprlang order 0.05, 0.9, 0.1, 1.05 is rejected as not exactly two points. A spring curve, hl.curve(name, { type = "spring", ... }), needs mass, stiffness and a damping field, each greater than 0.5. Hyprland 0.56.2 reads that field only as dampening, so the wiki's damping = 10 fails with hl.curve("<name>"): dampening expects a number and the curve is never created. Later Hyprland source on main reads damping and falls back to dampening, so dampening works on both. Leaf names are the animation tree names (windows, windowsIn, workspaces, specialWorkspace, fadeIn, border, layers and so on), case-sensitive.
On Omarchy 4, /usr/share/omarchy/default/hypr/looknfeel.lua sets hl.animation({ leaf = "workspaces", enabled = false }), so workspace switching is instant by design until you enable that leaf yourself. It also defines the curves easeOutQuint, easeInOutCubic, linear, almostLinear and quick, which load before your files and can be reused.
Fix
**Omarchy 4: put animation changes in ~/.config/hypr/looknfeel.lua.** It loads after Omarchy's defaults, so your lines win and Omarchy's curves already exist.
-- ~/.config/hypr/looknfeel.lua
-- hyprlang: bezier = myBezier, 0.05, 0.9, 0.1, 1.05
hl.curve("myBezier", { type = "bezier", points = { { 0.05, 0.9 }, { 0.1, 1.05 } } })
-- hyprlang: animation = windows, 1, 7, myBezier
-- use bezier = (or spring =), not curve =
hl.animation({ leaf = "windows", enabled = true, speed = 7, bezier = "myBezier" })
hl.animation({ leaf = "windowsIn", enabled = true, speed = 7, bezier = "myBezier", style = "popin 80%" })
-- Omarchy turns workspace animations off. Turn them back on with a shipped curve:
hl.animation({ leaf = "workspaces", enabled = true, speed = 4, bezier = "easeOutQuint", style = "slide" })
-- a spring curve:
-- Hyprland 0.56.2 reads "dampening", not the wiki's "damping".
-- mass, stiffness and dampening must each be greater than 0.5.
hl.curve("bouncy", { type = "spring", mass = 1, stiffness = 70, dampening = 10 })
hl.animation({ leaf = "fadeIn", enabled = true, speed = 3, spring = "bouncy" })
-- disable one leaf, or all animations:
hl.animation({ leaf = "border", enabled = false })
-- hl.config({ animations = { enabled = false } })
**Plain Arch:** the same calls go in ~/.config/hypr/hyprland.lua. Define every hl.curve above the first hl.animation that names it.
speed is in deciseconds (speed = 7 is 700 ms) and must be greater than 0. Valid style values depend on the leaf: slide, popin, gnomed for windows, and slide, slidevert, fade, slidefade, slidefadevert for workspaces.
Verify
hyprctl configerrors shows no hl.animation or hl.curve lines, and hyprctl animations lists your curve name and the leaf with the speed you set. Switching workspaces with SUPER+1 and SUPER+2 now animates if you enabled the workspaces leaf. The bezier/spring requirement was read from the 0.56.2 source. It was not exercised live.
Sources
- https://wiki.hypr.land/configuring/core/animations/
- https://wiki.hypr.land/configuring/core/config-options/
- https://github.com/hyprwm/Hyprland/blob/v0.56.2/src/config/lua/bindings/LuaBindingsConfigRules.cpp
- https://github.com/omacom/omarchy/blob/quattro/default/hypr/looknfeel.lua
- https://github.com/omacom/omarchy/blob/quattro/config/hypr/looknfeel.lua
- https://github.com/hyprwm/Hyprland/blob/main/src/config/lua/bindings/LuaBindingsConfigRules.cpp