Skip to content

Add niri-animations plugin - #223

Merged
ItsLemmy merged 1 commit into
noctalia-dev:mainfrom
ImJustDoingMyPart:add-niri-animations
Aug 3, 2026
Merged

Add niri-animations plugin#223
ItsLemmy merged 1 commit into
noctalia-dev:mainfrom
ImJustDoingMyPart:add-niri-animations

Conversation

@ImJustDoingMyPart

Copy link
Copy Markdown
Contributor

Plugin

  • Id: imjustdoingmypart/niri-animations
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

Lets you switch niri animation presets from a Noctalia panel instead of editing config and
reloading the compositor by hand.

The plugin owns one file — ~/.config/niri/animations.kdl by default — and rewrites it with
an include for the chosen preset plus an animations block carrying the global speed:

include "./animations/prism_fold.kdl"

animations {
    slowdown 1.50
}

Then it runs the reload command. It never touches config.kdl; that file is expected to
include the target file last, after your base animations.

The panel offers a preset dropdown (plus No preset, which falls back to your base pack), an
on/off toggle, a 0.25×–3.00× speed slider, and a Random button. Two panel entries ship the
same script with different anchoring — picker floating and docked attached to the bar —
because placement is host-owned and cannot be changed at runtime or overridden by the user.
A control-center tile opens the attached one and highlights while animations are enabled.

Presets are listed by filename on purpose: preset headers carry a free-form Desc: field
that is frequently just "imported from https://…", and surfacing it makes the plugin look
broken when the problem is somebody else's metadata.

External dependencies

niri — used for the reload command (niri msg action load-config-file, configurable).
Declared in dependencies in plugin.toml. No other external commands, and no network
access.

Testing

Exercised on a live session against 19 presets:

  • Opened both panels via IPC (panel-toggle …:picker and …:docked) and confirmed each
    registers and renders.

  • Picked presets from the dropdown, toggled animations off and on, moved the speed slider,
    and used Random — verifying each writes the target file and that niri reloads.

  • Confirmed the panel reopens reflecting the on-disk state (selected preset, speed, on/off)
    after external edits to the target file.

  • Validated all three generated shapes (preset + slowdown, no preset + slowdown, off)
    with niri validate against a full config tree.

  • Verified the control-center tile reflects the enabled/disabled state.

  • Tested on Niri

  • Tested on Hyprland

  • Tested on Sway

  • Tested on another compositor:

  • Noctalia version tested against: 5.0.0-beta.7 (noctalia v5.0.0 (97917d9ca07e))

  • Plugin API level: 9

On plugin_api: I set 9 to match the official example plugin, which demonstrates the same
entry types (panels with the declarative ui.* vocabulary, plus a shortcut). The docs don't
state which level first shipped ui.select, listDir/writeFile/runAsync, or root-level
[[setting]], so I could not derive the true minimum. Happy to lower it if a reviewer knows
it should be lower.

Screenshots / Videos

thumbnail.webp in this PR embeds a live capture of the picker panel (preset dropdown on
tv_crt, speed at 1.00×, 19 presets discovered). Full-resolution screenshots of both the
floating and bar-attached variants follow in a comment.

Checklist

  • The directory name matches the part of id after the / in plugin.toml exactly.
  • It ships plugin.toml, README.md, thumbnail.webp, and translations/en.json.
  • README.md follows the
    README template, documents
    every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • I created thumbnail.webp with the thumbnail generator.
  • version follows semver and is bumped in this PR; plugin_api is the oldest API level
    this plugin requires.
  • Every non-English translation in this PR uses a locale supported by Noctalia core, and I
    can read, write, and understand that language well enough to review and maintain it (no
    unreviewed machine/LLM translations).
  • I did not edit catalog.toml; CI generates it.
  • This PR touches exactly one plugin directory.

Code review attestation

  • The code is readable and not obfuscated, minified, or generated.
  • It does not download and execute remote code.
  • Every network call, filesystem write, and spawned process is something the description
    above accounts for.
  • I have the right to publish this code under the license declared in plugin.toml.

Animation preset picker for niri: choose a .kdl preset, set the global
slowdown factor, or turn animations off. Ships a floating and a
bar-attached panel plus a control-center tile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ImJustDoingMyPart

Copy link
Copy Markdown
Contributor Author
noctalia

@ItsLemmy
ItsLemmy merged commit 5dc0808 into noctalia-dev:main Aug 3, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants