geekmagic-stats
Push live Claude Code usage stats and macOS disk space to a GeekMagic SmallTV display over your local network.

The device auto-cycles between screens every 10 seconds in album mode.
Screens
Claude Code Usage

- Session (5-hour) and Weekly (7-day) usage windows
- Gradient progress bars with pace markers showing expected vs actual usage
- Pace indicator: whether your current rate lasts to reset, or an ETA when it runs out
- Reset countdown and remaining percentage
- Local timestamp
Disk Usage

- Anti-aliased donut chart with gradient coloring
- Free space percentage in the center
- Used/free breakdown in GB
Requirements
- GeekMagic SmallTV Ultra (240x240, tested on firmware Ultra-V9.0.43)
- claude-code-stats crate (used as an in-process Rust library)
- Rust toolchain
Install
This installs two binaries to ~/.cargo/bin/:
geekmagic-stats— stats screen (+ optional disk)geekmagic-disk— disk screen standalone
Usage
One-shot push
# Push stats screen only (uses host from config)
# Push stats + disk as auto-cycling album
# Custom device IP
# Save to file instead of pushing
Configuration
By default, config is read from ~/.config/geekmagic-stats/config.toml.
= "10.0.1.102"
= 300
= true
host is required for uploads unless you only use --output.
You can override the path with --config /path/to/config.toml.
Precedence order:
- CLI flags
- config file
- built-in defaults (
with_disk = false, no default daemon)
geekmagic-disk supports the same config file and --config flag.
Daemon mode
Push updated screens every 5 minutes:
The interval (in seconds) has a minimum of 10s to avoid flooding the device.
Run on startup (macOS)
Create ~/Library/LaunchAgents/com.geekmagic.stats.plist:
Label
com.geekmagic.stats
ProgramArguments
/Users/YOU/.cargo/bin/geekmagic-stats
--config
/Users/YOU/.config/geekmagic-stats/config.toml
KeepAlive
StandardOutPath
/tmp/geekmagic-stats.log
StandardErrorPath
/tmp/geekmagic-stats.log
Then load it:
Manage:
# View logs
# Stop (auto-restarts due to KeepAlive)
# Disable completely
# Restart after rebuilding
&&
How it works
- Uses the
claude-code-statscrate to collect current API usage as JSON - Computes pace locally (rate of usage vs time remaining) if not provided by the API
- Renders 240x240 dark-themed images using
image+imageproc+ab_glyphwith the Inter font - Encodes to JPEG and uploads via multipart POST to the device's HTTP API
- Sets album mode with autoplay so the device cycles between screens
The device runs a plain HTTP server with no authentication. Images are uploaded to /doUpload?dir=/image/ and displayed by setting theme 3 (Photo Album).
Project structure
src/
config.rs Loads config from ~/.config/geekmagic-stats/config.toml
main.rs CLI entry point, daemon loop
stats.rs Calls claude-code-stats crate, parses JSON, computes pace
render.rs Renders the stats screen (progress bars, text)
disk.rs Standalone disk usage binary
disk_render.rs Renders the disk donut chart
upload.rs JPEG encoding, device upload, album management
lib.rs Shared library (upload + disk_render)
fonts/
Inter-Regular.ttf
Inter-Bold.ttf
Device compatibility
Built for the GeekMagic SmallTV Ultra (240x240 LCD). The device firmware has some HTTP quirks (duplicate Content-Length headers, data after Connection: close) which are handled gracefully.
Should work with other GeekMagic models that support the same HTTP API and Photo Album theme — the SmallTV Pro uses theme 4 instead of 3 and has a 128x128 display.