Skip to content

Feature request: generic file-feed custom segment for third-party toolsΒ #91

Description

@n0mad-ai

Hi πŸ‘‹ β€” first off, thanks for claude-powerline. We've vendored it (MIT) as the statusline engine for bastra-recall, and it's been a great base to build on.

We'd like to contribute a feature back, but wanted to check appetite before opening a PR.

The gap

Today the documented way to show custom / third-party output is to wrap the binary in a shell script. That works, but the custom bit then lives outside the powerline chain β€” it can't sit between your segments with its own color, icon, and position. There's no way for a background tool to surface a live status inline.

Proposal: a generic custom segment that renders a file

A background tool (CI watcher, test runner, deploy status, container health, …) writes a small JSON file; the segment reads it and renders it via a template. Deliberately file-based, not command-based β€” no arbitrary exec from config, just an fs.read per refresh, and it doesn't overlap with the existing shell-wrapping approach.

Sketch:

"custom": {
  "enabled": true,
  "file": "~/.mytool/status.json",
  "format": "{label}{count?Β· {count}}",
  "icon": "οƒ…",       // optional, Nerd Font glyph
  "color": "#7c3aed",     // optional, falls back to the theme
  "staleAfter": 10000     // optional: hide if mtime older than N ms
}

The template stays intentionally tiny β€” three tokens, no logic β€” so it's a display helper, not a DSL:

  • {field} β€” value from the JSON
  • {field?Β· text} β€” text only when field is truthy
  • {elapsed:tsField} β€” Date.now() βˆ’ feed[tsField], formatted as a live duration

Our own use case (bastra-recall surfacing live recall activity) would just be one config of this β€” but the segment itself is tool-agnostic.

What we'd bring

The full PR β€” segment + provider, theme entries across all six themes, config/defaults wiring, docs, and tests β€” matching your existing segment conventions.

Would you be open to this? Happy to adjust the shape (naming, token set, file-vs-command) to whatever fits your design. And if you'd rather keep custom output external, totally understand β€” we'll keep it vendored on our side either way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions