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.
- 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
- Anti-aliased donut chart with gradient coloring
- Free space percentage in the center
- Used/free breakdown in GB
- GeekMagic SmallTV Ultra (240x240, tested on firmware Ultra-V9.0.43)
- claude-code-stats crate (used as an in-process Rust library)
- Rust toolchain
cargo install --path .This installs two binaries to ~/.cargo/bin/:
geekmagic-stats— stats screen (+ optional disk)geekmagic-disk— disk screen standalone
# Push stats screen only (uses host from config)
geekmagic-stats
# Push stats + disk as auto-cycling album
geekmagic-stats --with-disk
# Custom device IP
geekmagic-stats --host 192.168.1.50 --with-disk
# Save to file instead of pushing
geekmagic-stats --output preview.pngBy default, config is read from ~/.config/geekmagic-stats/config.toml.
host = "10.0.1.102"
daemon = 300
with_disk = truehost 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.
Push updated screens every 5 minutes:
geekmagic-stats -d 300 --with-diskThe interval (in seconds) has a minimum of 10s to avoid flooding the device.
Create ~/Library/LaunchAgents/com.geekmagic.stats.plist:
<?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.geekmagic.stats</string>
<key>ProgramArguments</key>
<array>
<string>/Users/YOU/.cargo/bin/geekmagic-stats</string>
<string>--config</string>
<string>/Users/YOU/.config/geekmagic-stats/config.toml</string>
</array>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/geekmagic-stats.log</string>
<key>StandardErrorPath</key>
<string>/tmp/geekmagic-stats.log</string>
</dict>
</plist>Then load it:
launchctl load ~/Library/LaunchAgents/com.geekmagic.stats.plistManage:
# View logs
tail -f /tmp/geekmagic-stats.log
# Stop (auto-restarts due to KeepAlive)
launchctl stop com.geekmagic.stats
# Disable completely
launchctl unload ~/Library/LaunchAgents/com.geekmagic.stats.plist
# Restart after rebuilding
cargo install --path . && launchctl kickstart -k gui/$(id -u)/com.geekmagic.stats- 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).
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
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.


