Skip to content

Add mangowm-status: display and switch Mangowm layouts - #147

Draft
x0d7x wants to merge 2 commits into
noctalia-dev:mainfrom
x0d7x:main
Draft

Add mangowm-status: display and switch Mangowm layouts#147
x0d7x wants to merge 2 commits into
noctalia-dev:mainfrom
x0d7x:main

Conversation

@x0d7x

@x0d7x x0d7x commented Jul 29, 2026

Copy link
Copy Markdown

Plugin

  • Id: x0d7x/mangowm-status
  • New plugin
  • Update to an existing plugin

What it does

A Noctalia v5 bar widget that shows the current Mangowm tiling layout and keymode. Click the widget to open a scrollable layout picker panel — choose any of the
14 supported layouts and switch instantly. Horizontal scroll over the widget cycles through layouts without opening the panel.

The widget is minimal by default: shows layout icon + letter code. Configurable to hide when keymode is default, show the keymode name, and notify on changes.

External dependencies

  • mmsg — Mangowm's IPC CLI. Used to query the current layout (mmsg get all-tags), watch for changes (mmsg watch all-tags / mmsg watch keymode), and switch
    layouts (mmsg dispatch setlayout,). Declared in plugin.toml as dependencies = ["mmsg"].

Testing

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor: Mangowm
  • Noctalia version tested against: 5.0.0~beta1
  • Plugin API level: 4

Tested:

  1. Widget renders current layout icon + letter on bar
  2. Left-click → layout picker panel opens with current layout highlighted
  3. Click a different layout → switches immediately, panel closes, widget updates
  4. Horizontal scroll → cycles through layouts
  5. noctalia msg panel-toggle x0d7x/mangowm-status:layout-picker opens/closes panel
  6. noctalia msg plugin ... set-layout G sets layout to grid
  7. noctalia msg plugin ... get-status returns JSON in logs
  8. All 3 settings (hide on default, show text, notify on change) work correctly

Screenshots / Videos

image image

Mangowm Status

Checklist

  • Directory name matches the part of id after the /
  • Ships plugin.toml, README.md, thumbnail.webp, translations/en.json
  • README follows the template, documents entries and dependencies
  • Thumbnail created at 960×540 WebP
  • version bumped, plugin_api = 4
  • Only English translations (no machine-translated locales)
  • Did not edit catalog.toml
  • PR touches exactly one plugin directory

Code review attestation

  • Code is readable, not obfuscated/minified/generated
  • Does not download or execute remote code
  • Only spawns mmsg subprocesses — no network calls, no unexpected filesystem writes
  • I have the right to publish this code under MIT license

@ItsLemmy

Copy link
Copy Markdown
Contributor
  1. non-blocking - mangowm-status/panel.luau:43

    doRender() is called from inside setLayout (defined at panel.luau:30), but doRender
    is declared as local function doRender later at panel.luau:64. At the call site the name
    is not yet a visible local, so it compiles as a global read and evaluates to nil.

    Impact is limited to the failure path: when mmsg dispatch setlayout,<name> returns a
    non-zero exit code, the error notification fires and then the callback aborts with
    "attempt to call a nil value (global 'doRender')". The panel is left showing stale
    state instead of re-rendering. Fix by forward-declaring (local doRender before
    setLayout, then function doRender()), or by moving doRender above setLayout.

  2. non-blocking - mangowm-status/plugin.toml:8

    icon = "grid" is not a resolvable glyph name. It is absent from the Tabler catalog
    (assets/fonts/tabler.json) and absent from the Noctalia alias table, so the registry
    logs "missing glyph: grid" and substitutes the missing-glyph placeholder wherever the
    manifest icon is rendered (plugin manager, widget picker, catalog entry). The glyphs used
    inside the Luau entries (columns, menu, dashboard, window, cards, layout) all resolve
    correctly, so only the manifest-level icon is affected. Candidates that do resolve:
    grid-4x4, grid-3x3, layout, dashboard.

  3. non-blocking - mangowm-status/widget.luau:126

    update() sets a 1000 ms interval and calls pollLayout() on every tick, which spawns
    a fresh mmsg get all-tags subprocess once per second for the lifetime of the bar.
    Two persistent mmsg watch streams (widget.luau:81, widget.luau:96) already deliver
    layout and keymode changes, so the poll is a redundant fallback running at a very high
    rate. The README documents the behavior honestly, so this is a resource concern rather
    than a correctness or trust issue. A longer interval (for example 5-15 s), or arming the
    poll only when a stream has not reported, would cut the process churn substantially.

Thumbnail should use the provided generator and not a home made banner.

@ItsLemmy
ItsLemmy marked this pull request as draft July 29, 2026 13:22
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