Repository navigation
v0.4.0 - Multi-Monitor Caching
🚀 New Features
File-Based Caching System
Solves the "Net Err" issue on multi-monitor setups where multiple Waybar instances (one per display) make concurrent API requests that get rate-limited.
- Automatic caching: API responses cached to
~/.cache/waybar-ai-usage/ - 60-second TTL: Fresh data while avoiding rate limits
- Concurrent request prevention: Uses
.updatingmarker files to coordinate between instances - Shared data: All monitors display the same cached data
- Zero configuration: Works automatically out of the box
How It Works
Before (v0.3.0):
Monitor 1 Waybar → API request → Rate limited ❌
Monitor 2 Waybar → API request → Rate limited ❌
Monitor 3 Waybar → API request → Success ✓
After (v0.4.0):
Monitor 1 Waybar → API request → Cache saved → Success ✓
Monitor 2 Waybar → Read cache → Success ✓
Monitor 3 Waybar → Read cache → Success ✓
🔧 Technical Details
- Cache location:
~/.cache/waybar-ai-usage/claude.jsonandcodex.json - Prevents race conditions with temporary marker files
- Falls back to stale cache if API request fails
- Works seamlessly with the existing click-to-refresh behavior
🐛 Bug Fixes
- Fix python-sly dependency in PKGBUILD and .SRCINFO
📝 Full Changelog
feat: add file-based caching to prevent concurrent API requests - ce48e05
- Add
get_cached_or_fetch()function in common.py - Implement 60-second TTL caching mechanism
- Use marker files to prevent concurrent requests
- Both claude-usage and codex-usage now share cached data
fix: add python-sly dependency - d36a3d0, 9570881
- Add missing python-sly dependency to PKGBUILD
🔗 Installation
AUR (Arch Linux)
yay -Syu waybar-ai-usageuv tool
uv tool install git+https://github.com/NihilDigit/waybar-ai-usage@v0.4.0⚠️ Breaking Changes
None. This release is fully backwards compatible.
📖 Waybar Configuration
The refresh behavior has been improved. To ensure manual refresh clears the cache:
See the README for complete configuration examples.