Skip to content

Repository files navigation

TokenTicker for Your Moltbot 🦞

Token Ticker Widget

macOS OpenClaw License

Why TokenTicker?

Tokens are the new currency and it's handy to monitor them, right from your desktop!

Features

  • 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

Install

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

How It Works

TokenTicker              OpenClaw (local files)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Widget  │──read──────│ ~/.openclaw/agents/   β”‚
β”‚  (60s)   │◀─sessions──│   sessions.json       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Reads session data directly from ~/.openclaw/agents/ β€” no subprocess needed.

Start on Login

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

Note: 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.plist

To re-enable, run the load command again. Token Ticker remembers its window position between restarts.

Start on Login

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

Note: 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.plist

To re-enable, run the load command again. Token Ticker remembers its window position between restarts.

Make It Your Own

All visual tweaks live in ContentView.swift:

Font size & weight:

.font(.system(size: 42, weight: .light))  // percentage display
.font(.system(size: 13, weight: .medium)) // labels

Spacing:

.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

Changelog

v1.4

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

v1.3

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

v1.2

  • Fix: model display now tracks the actual model in use. Reads modelOverride from OpenClaw session data instead of shelling out to openclaw 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.

v1.1

  • Dynamic model name β€” The widget now reads the active model from openclaw sessions instead of displaying a hardcoded name. Supports Claude, GPT, and other model naming conventions.

v1.0

  • Initial release β€” floating desktop widget with token usage percentage, trend lobster, and auto-refresh.

Credits

Built by Liz Myers & Claude, for the OpenClaw community.

License

MIT

About

🦞 macOS desktop widget to monitor AI API token usage in real-time

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages