Tokens are the new currency and it's handy to monitor them, right from your desktop!
- Glanceable β Large percentage, always visible on your desktop
- Auto-refresh β Polls every 60 seconds
- Zero config β Reads your existing OpenClaw session, no API keys to enter
- Lightweight β Native Swift, minimal footprint
git clone https://github.com/LizMyers/token-ticker.git
cd token-ticker
swift build -c release
cp .build/release/TokenTicker /Applications/Launch with Spotlight: Cmd+Space β TokenTicker
IMPORTANT β select the executable, not the folder
Requires: macOS 13+ and OpenClaw
TokenTicker openclaw CLI OpenClaw (local)
ββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Widget βββrunββββββββ openclaw βββreadsββββ session state β
β (60s) βββjsonβββββββ sessions β β (SQLite-backed) β
ββββββββββββ β --json β βββββββββββββββββββ
ββββββββββββββββ
Shells out to openclaw sessions --json for live session data, all local β no network calls. This used to read ~/.openclaw/agents/*/sessions/sessions.json directly, but OpenClaw migrated session storage into a SQLite-backed store and that flat file no longer exists on current installs, so the direct-read approach silently broke. The CLI is the stable interface regardless of what's underneath.
Want Token Ticker waiting for you every morning? Add a LaunchAgent:
# Create the plist (update the path to match your setup)
cat > ~/Library/LaunchAgents/com.liz.token-ticker.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.liz.token-ticker</string>
<key>ProgramArguments</key>
<array>
<string>/YOUR/PATH/TO/token-ticker/.build/release/TokenTicker</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
</dict>
</plist>
EOF
# Enable it
launchctl load ~/Library/LaunchAgents/com.liz.token-ticker.plistNote: The EnvironmentVariables section ensures Token Ticker can find openclaw when launching at login. Without it, the widget will appear empty.
To disable auto-launch later:
launchctl unload ~/Library/LaunchAgents/com.liz.token-ticker.plistTo re-enable, run the load command again. Token Ticker remembers its window position between restarts.
All visual tweaks live in ContentView.swift:
Font size & weight:
.font(.system(size: 42, weight: .light)) // percentage display
.font(.system(size: 13, weight: .medium)) // labelsSpacing:
.padding(.top, 23)
.padding(.bottom, 26)
.padding(.leading, 20)Widget size:
.frame(width: 160, height: 160)Refresh interval (in TokenDataProvider.swift):
Timer.scheduledTimer(withTimeInterval: 60, repeats: true) // seconds- Fix: widget froze on stale/default token counts. OpenClaw migrated session storage from a flat
~/.openclaw/agents/*/sessions/sessions.jsonfile into a SQLite-backed store; that file no longer exists on current OpenClaw installs, so the v1.2 direct-file-read change always silently failed. Back to shelling out toopenclaw sessions --jsonβ the stable interface regardless of what's underneath β this time reading it correctly. - Fix: widget could float above whatever app you were using. Launch no longer steals keyboard focus (
orderFrontinstead ofmakeKeyAndOrderFront). - Darker, less transparent background by default.
- Apple-style frosted glass effect. Widget now uses NSVisualEffectView with blur material to match macOS Weather widget aesthetic. Features forced dark appearance with desktop wallpaper blur in both light and dark modes.
- Light mode fix: updated background styling. Widget now uses a semi-transparent black background with white text in both light and dark modes, matching macOS Weather widget aesthetic. Removed frosted glass effect for cleaner appearance.
- Fix: model display now tracks the actual model in use. Reads
modelOverridefrom OpenClaw session data instead of shelling out toopenclaw sessions, so switching models (e.g. Haiku to Gemma) updates correctly. - Session sorting by recency. When multiple sessions exist, picks the most recently active one.
- No more subprocess. Reads
~/.openclaw/agents/directly β faster and more reliable.
- Dynamic model name β The widget now reads the active model from
openclaw sessionsinstead of displaying a hardcoded name. Supports Claude, GPT, and other model naming conventions.
- Initial release β floating desktop widget with token usage percentage, trend lobster, and auto-refresh.
Built by Liz Myers & Claude, for the OpenClaw community.
MIT
