Skip to content

gnoblin.animation ​

Register a named animation for one supported event. Declarations with the same name merge during a config load. Disable an imported animation by registering its name with enable = false. The animation guide covers events, presets and keyframe examples.

lua
gnoblin.animation {
    name = "soft-open",
    event = "open",
    duration = 280,
    ease = "ease-out-cubic",
    origin = "center",
    from = {y = 18, scale = 0.94, opacity = 0},
    to = {y = 0, scale = 1, opacity = 1},
}
FieldAccepted valuesDefault and effect
nameRequired unique name; letters, digits, _ and -; maximum 80 charactersSelects this registration from settings and window rules.
enableBooleantrue; set to false to disable a registration by name.
eventOne event listed in the animation guideSelects the transition this animation controls.
durationInteger milliseconds from 0 to 10000Uses the event preset's duration when omitted; 0 completes immediately.
easeNamed curve or {type = "cubic-bezier", x1, y1, x2, y2}Uses the event preset's curve when omitted. See curve values.
from, toProperty-value maps supported by the eventStart and end state. Supply these or keyframes.
keyframesOrdered frames from at = 0 through at = 1Defines intermediate states instead of endpoint interpolation.
originNamed pivot or normalized {x, y} pair"center"; sets the transform pivot. See accepted pivot values.
targetOptional string label"none"; displayed by inspection tools.

Provide from and/or to, or provide keyframes. The animation guide lists all supported events, properties, curves, pivots, and event-specific defaults.

Type definition ​

? marks optional fields and | separates alternatives. Event-specific properties are described in the linked guide.

lua
gnoblin.animation {
    name = string,
    event = "minimize" | "restore" | "open" | "close" | "dialog-open" | "dialog-close"
        | "layer-open" | "layer-close" | "workspace-switch" | "console-open"
        | "console-close" | "shadow-change" | "layer-companion-close" | "resize"
        | "tile-preview-open" | "tile-preview-close" | "dialog-dim" | "dialog-undim",
    enable = boolean?,
    duration = integer?, -- 0–10000 ms
    ease = "linear" | "ease-in-quad" | "ease-out-quad" | "ease-in-out-cubic"
        | "ease-in-cubic" | "ease-out-cubic" | "ease-out-expo" | "ease-out-back"
        | {type = "cubic-bezier", x1 = number, y1 = number, x2 = number, y2 = number}?,
    from = {property = number, ...}?, -- allowed properties depend on event
    to = {property = number, ...}?, -- allowed properties depend on event
    keyframes = {{at = number, property = number, ease = string?, ...}, ...}?, -- 2–128 frames; endpoints at 0 and 1
    origin = "center" | "top-left" | "top-center" | "top-right" | "bottom-left"
        | "bottom-center" | "bottom-right" | {number, number}?, -- normalized 0–1 pair
    target = string?,
}