Skip to content

Add felipeartur/ai-usagebar - #374

Closed
FelipeArtur wants to merge 2 commits into
noctalia-dev:mainfrom
FelipeArtur:ai-usagebar-plugin
Closed

Add felipeartur/ai-usagebar#374
FelipeArtur wants to merge 2 commits into
noctalia-dev:mainfrom
FelipeArtur:ai-usagebar-plugin

Conversation

@FelipeArtur

@FelipeArtur FelipeArtur commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Plugin

  • Id: felipeartur/ai-usagebar
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

Puts your AI plan quota in the bar. The capsule shows the headline percentage of
a provider behind that provider's icon, and reads in the bar's own colour until
the CLI calls the window high or critical, at which point it picks up tertiary
or error. Four styles: a plain percentage, a gauge, five segments, or the name
and percentage stacked over the bars. Beside that it can carry the time left in
the window and the pace against the clock, and one capsule can carry up to four
providers, busiest first.

Clicking it opens a two pane panel: every provider you have set up on the left,
the selected one in detail on the right, with a card per quota window. Each card
shows the label, the severity the CLI assigned, the percentage, how much of the
window has elapsed as a second thinner bar, the time left with the clock time or
date its reset lands on, and the pace line. Credit blocks and free text rows the
CLI reports are rendered too.

The numbers come from ai-usagebar,
a Rust CLI that reads Claude, Codex, Cursor, Antigravity, Kiro, Z.AI, OpenRouter,
DeepSeek, Kimi and Grok, among others. The plugin never talks to a provider,
holds a token, or reads a credential file.

External dependencies

ai-usagebar, declared in dependencies and run by name from PATH. One
process per read: ai-usagebar usage --json. The CLI owns credentials, provider
endpoints and its own caching; the plugin parses that stdout and draws it.

Testing

Running in my bar against a live Claude Pro plan and a ChatGPT Free plan, with
three more providers configured in the CLI without credentials. Exercised: all
four capsule styles and both extras; provider_limit from 1 to 4; the tooltip;
left click opening the panel; right click refreshing; provider selection inside
the panel; noctalia msg panel-toggle and panel-open; both IPC events on the
poller; the widget settings dialog and the plugin settings dialog. Providers
with no credential are filtered out of the list, and a reset more than a week
out was checked for its absolute date. noctalia plugins lint and this repo's
validate-plugins.py are both clean.

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Noctalia version tested against: 5.0.0_beta.8
  • Plugin API level: 9

Screenshots / Videos

The capsule and the panel, from a running session:
https://raw.githubusercontent.com/FelipeArtur/community-plugins/ai-usagebar-plugin/ai-usagebar/thumbnail.webp

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.

Unchecked deliberately. The thumbnail is composed from screenshots of the plugin running and exported as a
960x540 WebP, but not through the generator page. Say the word and I will re-export it there.

  • 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.

English is the only translation shipped. The plugin makes no network calls and writes no files. The only process it
spawns is ai-usagebar usage --json, from the poller service, and the poller refuses to start one within two
seconds of the last. Text that comes back from the CLI is rendered, so it is first collapsed to one line, capped at
200 characters, and stripped of anything shaped like key=, token=, secret= or Bearer <value> before it
reaches a tooltip.

Notes

plugin_api is 9 because row selection in the panel uses a closure as a click
handler. Everything else the plugin needs exists at 3.

A headless poller runs `ai-usagebar usage --json` on an interval and
publishes the report to plugin state; the capsules and the panel are
pure subscribers, so a second capsule or a second monitor costs no
extra process. Severity and absolute reset stamps come from the CLI,
so the plugin carries no vendor table and no countdown parsing.
Nest translations/en.json, add the 960x540 thumbnail and rewrite the
README on the template, so validate-plugins.py passes.

Fix the reset weekday: formatTime passes unknown text through verbatim,
so a "ddd" prefix rendered literally. Build it with os.date instead.

Shrink the panel to 380px; the footer does not stretch to the bottom,
so the taller box only added empty space.
@github-actions

Copy link
Copy Markdown
Contributor

This pull request was automatically closed because its description no longer contains
every part of the pull request template
that this repository requires.

Missing:

  • the checklist entry: Every network call, filesystem write, and spawned process is something the description above accounts for.

Please add the items listed above back to the description, keeping their exact wording, then
reopen the pull request. Reopening re-runs this check. Only the marker line, the ## headings,
the - **Field:** lines, and the - [ ] checklist entries are required; the guidance comments
in the template are yours to delete, and checklist boxes may stay unchecked while the pull
request is a draft.

@github-actions github-actions Bot closed this Aug 15, 2026
@FelipeArtur FelipeArtur changed the title ai-usagebar: AI plan usage in the bar Add felipeartur/ai-usagebar Aug 16, 2026
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.

1 participant