mirror of
https://github.com/tiennm99/claude-code-usage-bubble.git
synced 2026-06-06 08:11:45 +00:00
c0f3e3f860
Windows-only floating, draggable circular bubble showing Claude Code and Codex usage. Derivative of CodeZeno/Claude-Code-Usage-Monitor (MIT), relicensed under Apache 2.0 with upstream attribution in NOTICE. - Ported verbatim: poller, updater, tray_icon, theme, localization, diagnose, models (~2,700 LOC) - Original: bubble (circular layered window, drag-anywhere via WM_NCHITTEST+HTCAPTION, snap-to-edge, Ctrl+Wheel resize, auto-hide on fullscreen), panel (expanded 5h/7d view), app (orchestrator, single-instance mutex, polling thread, context menu, dual-bubble lifecycle), settings (settings.json persistence) - Cargo.toml features cover Win32 GDI, HiDpi, Registry, Threading, Shell, WindowsAndMessaging, and KeyboardAndMouse
20 lines
409 B
Rust
20 lines
409 B
Rust
use std::time::SystemTime;
|
|
|
|
#[derive(Clone, Debug, Default)]
|
|
pub struct UsageSection {
|
|
pub percentage: f64,
|
|
pub resets_at: Option<SystemTime>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Default)]
|
|
pub struct UsageData {
|
|
pub session: UsageSection,
|
|
pub weekly: UsageSection,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Default)]
|
|
pub struct AppUsageData {
|
|
pub claude_code: Option<UsageData>,
|
|
pub codex: Option<UsageData>,
|
|
}
|