Waybar custom module for CodexBar usage data.
It shows Codex and Claude remaining usage in the bar and renders a rich tooltip with:
- session and weekly meters
- CodexBar-compatible pace wording (
in deficit,in reserve,Expected X% used) - reset countdowns
- run-out / lasts-until-reset projection
- Codex credits when available
- Arch Linux / Waybar
jq- Ruby for the installer/uninstaller helpers
The package bundles the upstream CodexBar Linux CLI release from https://github.com/steipete/codexbar and installs it as /usr/bin/codexbar, so a separate CodexBar or Homebrew install is not required.
If you previously had a hand-written ~/.local/bin/codexbar-waybar, remove it; otherwise it can shadow the packaged executable. If you have another codexbar binary you intentionally want to use, set CODEXBAR_BIN.
cd ~/Work/codexbar-waybar
makepkg -siThe package downloads CodexBar CLI from GitHub releases and installs:
/usr/bin/codexbar/usr/lib/codexbar-waybar/CodexBarCLI/usr/bin/codexbar-waybar/usr/bin/codexbar-waybar-install/usr/bin/codexbar-waybar-uninstall/usr/share/codexbar-waybar/waybar/codexbar.jsonc/usr/share/codexbar-waybar/waybar/codexbar.css/usr/share/codexbar-waybar/waybar-tooltip.jq
After installing the package:
codexbar-waybar-installThe installer updates ~/.config/waybar/config.jsonc and ~/.config/waybar/style.css by:
- adding an
includefor/usr/share/codexbar-waybar/waybar/codexbar.jsonc - adding
custom/codexbartomodules-rightimmediately after Omarchy'sgroup/tray-expanderwhen present - importing
/usr/share/codexbar-waybar/waybar/codexbar.css - reloading Waybar with
SIGUSR2
Backups are created before changes.
To install into another section:
codexbar-waybar-install --section modules-left
codexbar-waybar-install --section modules-center
codexbar-waybar-install --section modules-rightUseful options:
codexbar-waybar-install --dry-run
codexbar-waybar-install --after group/tray-expander
codexbar-waybar-install --after '' # prepend if you do not want target placement
codexbar-waybar-install --no-css
codexbar-waybar-install --no-reload
codexbar-waybar-install --config-dir ~/.config/waybarRun this before uninstalling the package:
codexbar-waybar-uninstallIt removes the module from the configured section, removes the include, removes the CSS import, and reloads Waybar.
You can test without installing to /usr:
cd ~/Work/codexbar-waybar
CODEXBAR_WAYBAR_FILTER="$PWD/share/codexbar-waybar/waybar-tooltip.jq" \
./bin/codexbar-waybar | jq .To test the installer against the repo snippets:
CODEXBAR_WAYBAR_SHARE_DIR="$PWD/share" ./bin/codexbar-waybar-install --dry-runThe module reads these environment variables:
| Variable | Default | Description |
|---|---|---|
CODEXBAR_BIN |
codexbar |
CodexBar executable |
CODEXBAR_WAYBAR_SOURCE |
cli |
CodexBar source passed to codexbar usage |
CODEXBAR_WAYBAR_PROVIDER |
all |
CodexBar provider passed to codexbar usage; use both for Codex + Claude only |
CODEXBAR_WAYBAR_ACCOUNT |
unset | Passed as --account |
CODEXBAR_WAYBAR_ACCOUNT_INDEX |
unset | Passed as --account-index |
CODEXBAR_WAYBAR_ALL_ACCOUNTS |
unset | When true, passes --all-accounts |
CODEXBAR_WAYBAR_NO_CREDITS |
unset | When true, passes --no-credits |
CODEXBAR_WAYBAR_WEB_TIMEOUT |
unset | Passed as --web-timeout |
CODEXBAR_WAYBAR_EXTRA_ARGS |
unset | Extra whitespace-split args appended to codexbar usage |
CODEXBAR_WAYBAR_SHOW_ERRORS |
auto |
auto hides unsupported-provider noise when any provider has data; always shows all provider errors |
CODEXBAR_WAYBAR_CACHE_MAX_AGE |
1800 |
Cache TTL in seconds |
CODEXBAR_WAYBAR_FILTER |
/usr/share/codexbar-waybar/waybar-tooltip.jq |
jq tooltip renderer |
CODEXBAR_WAYBAR_PATH |
common user/system paths | PATH used by the module |
The installed include defines:
{ "custom/codexbar": { "exec": "codexbar-waybar", "return-type": "json", "interval": 1800, "format": "{}", "escape": false, "tooltip": true } }