You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release v0.2.0: provider logos, bar pin mode, Claude OAuth fallback
Three user-facing additions plus two reliability fixes:
Pin a provider to the bar
Settings now has a 'Show in bar' picker above the provider list with
chips for each enabled provider plus Highest. Picking a provider writes
~/.config/codexbar-waybar/state.json and signals waybar via SIGRTMIN+8
so the bar updates within a second. When pinned, the bar shows
'🤖 P% • W%' (session • weekly) instead of the cross-provider max.
Override per Waybar instance with CODEXBAR_BAR_PROVIDER.
Provider logos
Mirrors 39 SVG brand marks from upstream CodexBar (MIT, see
assets/providers/NOTICE) and renders them next to provider names in
both the tab strip and the Settings provider list. Recoloured at load
time for the light panel. install.sh drops them under
$XDG_DATA_HOME/codexbar-waybar/icons/.
Claude OAuth → CLI fallback
Anthropic's OAuth rate-limits aggressively. When the primary source
returns an error, the wrapper transparently retries with --source cli
so the popover never sticks on 'Cached — last refresh failed'. The
fallback uses the local Claude CLI logs and yields the same window
data.
Plus reset-text normalisation end-to-end (both OAuth output like
'May 17 at 6:20AM' and CLI output like 'Resets6:20am(Europe/Paris)' get
the missing spaces inserted) and refreshed README screenshots.
@@ -120,37 +148,41 @@ definition or your shell profile.
120
148
| Variable | Default | Purpose |
121
149
| --- | --- | --- |
122
150
|`CODEXBAR_BIN`|`~/.local/bin/codexbar`| Path to the CLI binary. |
123
-
|`CODEXBAR_STAGGER`|`0.5`| Seconds between provider fetches (raises this if Claude OAuth keeps 429-ing). |
124
-
|`CODEXBAR_PROVIDERS`| from config.json | Space-separated provider IDs to query, bypassing `~/.codexbar/config.json`. Set per-Waybar instance if you want different provider sets per monitor. |
|`CODEXBAR_STAGGER`|`0.5`| Seconds between provider fetches (raise it if Claude OAuth keeps 429-ing). |
152
+
|`CODEXBAR_PROVIDERS`| from `config.json`| Space-separated provider IDs to query, bypassing `~/.codexbar/config.json`. Set per-Waybar instance if you want different sets per monitor. |
153
+
|`CODEXBAR_BAR_PROVIDER`|from `state.json`|Pin a specific provider's session/weekly to the bar regardless of state. Set to a provider ID, or unset for `Highest`. |
126
154
|`CODEXBAR_LAYER_SHELL_LIB`| auto-detected | Override path to `libgtk4-layer-shell.so` if your distro stashes it somewhere unusual. |
155
+
|`XDG_CACHE_HOME`|`~/.cache`| Where `last.json` snapshots live. |
156
+
|`XDG_DATA_HOME`|`~/.local/share`| Where provider icons live (under `codexbar-waybar/icons/`). |
127
157
128
158
To change which providers appear, open the popover and click **Settings…** —
129
159
the inline view lets you toggle providers and Save back to
130
-
`~/.codexbar/config.json`. The wrapper script picks up the new list on the
131
-
next refresh (the popover nudges Waybar to refresh immediately via
132
-
`SIGRTMIN+8`). Codex and Claude need `--source oauth` on Linux; the wrapper
133
-
sets that automatically via `SOURCE_OVERRIDES` at the top of `codexbar.sh`.
160
+
`~/.codexbar/config.json`. Codex and Claude need `--source oauth`on Linux;
161
+
the wrapper sets that automatically via `SOURCE_OVERRIDES` at the top of
162
+
`codexbar.sh`and falls back to `--source cli` on errors where the CLI source
163
+
is available (currently: Claude).
134
164
135
165
## How it works
136
166
137
-
1. Waybar runs `codexbar.sh` every 60 s.
138
-
2. The script invokes `codexbar usage --provider <p> --format json` once per
139
-
enabled provider, sequentially, with a small stagger to dodge per-provider
140
-
rate limits.
167
+
1. Waybar runs `codexbar.sh` every 30 s (or whenever it receives
168
+
`SIGRTMIN+8`).
169
+
2. The script reads `~/.codexbar/config.json` to learn which providers are
170
+
enabled, then invokes `codexbar usage --provider <p> --format json` once
171
+
per enabled provider, sequentially, with a small stagger.
141
172
3. Each response is the same JSON payload the macOS menu-bar app consumes:
4. The shell wrapper collapses that into Waybar's JSON contract
145
-
`{"text", "tooltip", "class", "percentage"}` keyed on the highest
146
-
`usedPercent`.
174
+
balances, error info. Claude OAuth 429s trigger a transparent retry via
175
+
`--source cli` so the bar keeps working off the local Claude CLI logs.
176
+
4. The wrapper collapses the merged payload into Waybar's JSON contract
177
+
`{"text", "tooltip", "class", "percentage"}`. The `text` field honours
178
+
`~/.config/codexbar-waybar/state.json` (pinned provider) or falls back to
179
+
the highest `usedPercent` across all responses.
147
180
5. The latest successful per-provider response is cached at
148
-
`~/.cache/codexbar-waybar/last.json`. The popover paints from the cache for
149
-
an instant first frame, then refetches in the background.
150
-
151
-
The popup itself is a GTK4 + `gtk4-layer-shell` window anchored to the top-right
152
-
of the focused output, with all rendering done in pure CSS — no extra widget
153
-
frameworks.
181
+
`~/.cache/codexbar-waybar/last.json`. The popover paints from the cache
182
+
for an instant first frame and then refetches in the background.
183
+
6. The popover is a GTK4 + `gtk4-layer-shell` window anchored to the
184
+
top-right of the focused output. SVG provider logos are mirrored from
185
+
upstream CodexBar (MIT) and recoloured at load time for the light panel.
154
186
155
187
## States and styling
156
188
@@ -171,21 +203,23 @@ The Waybar module emits one of these classes; style them in
171
203
|`libxml2.so.2: cannot open shared object file`| Install your distro's libxml2 v2.13 compat (`libxml2-legacy` on Arch). |
172
204
| Module text is blank | Run `~/.config/waybar/scripts/codexbar.sh` directly — it should print one JSON line. |
173
205
| Popover never shows | Run `~/.config/waybar/scripts/codexbar-popup.py` from a terminal; check the warnings. The most common one is `gtk4-layer-shell` not preloading — set `CODEXBAR_LAYER_SHELL_LIB`. |
174
-
|`HTTP 429 rate_limit_error` from Claude | Raise `CODEXBAR_STAGGER=1.0` and the module `interval` to 120. |
175
-
| Tabs render dark / unreadable | You're probably running an old version that fought Adwaita. Pull latest and reinstall. |
206
+
|`HTTP 429 rate_limit_error` from Claude | The wrapper already falls back to the local Claude CLI source. If you still see persistent errors, raise `CODEXBAR_STAGGER=1.0` and the module `interval` to 60. |
207
+
| Provider logos look like blank squares | Re-run `./install.sh` to refresh `~/.local/share/codexbar-waybar/icons/`. |
208
+
| Bar pin doesn't update instantly | Make sure your Waybar module def has `"signal": 8` (the bundled `codexbar.jsonc` already does). |
176
209
177
210
## Roadmap
178
211
179
-
- Auto-dismiss on outside click (today: ESC, `✕`, or click the bar icon).
212
+
- Auto-dismiss the popover on outside click (today: ESC, `✕`, or clicking the
213
+
bar icon).
180
214
- Dark-mode palette (auto-detect from `gsettings color-scheme` or HyDE
181
215
wallbash).
182
216
- AUR `PKGBUILD` for one-shot install on Arch.
183
217
- Optional Quickshell variant for compositors without Waybar.
184
218
185
219
## Related
186
220
187
-
-[CodexBar](https://github.com/steipete/CodexBar) — the upstream macOS app and
188
-
Linux CLI this project wraps.
221
+
-[CodexBar](https://github.com/steipete/CodexBar) — the upstream macOS app
222
+
and Linux CLI this project wraps.
189
223
-[Win-CodexBar](https://github.com/Finesssee/Win-CodexBar) — Windows port of
190
224
the macOS app.
191
225
@@ -198,4 +232,7 @@ itself belongs in the
198
232
199
233
## License
200
234
201
-
MIT. See [LICENSE](LICENSE).
235
+
MIT. See [LICENSE](LICENSE). Provider SVG marks are redistributed from
236
+
upstream CodexBar under the same MIT license (see
237
+
[`assets/providers/NOTICE`](assets/providers/NOTICE)); the individual brand
238
+
marks remain the property of their respective owners.
0 commit comments