mirror of
https://github.com/tiennm99/claude-code-usage-bubble.git
synced 2026-06-06 18:12:46 +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
40 lines
875 B
Rust
40 lines
875 B
Rust
#![windows_subsystem = "windows"]
|
|
|
|
mod app;
|
|
mod bubble;
|
|
mod diagnose;
|
|
mod localization;
|
|
mod models;
|
|
mod native_interop;
|
|
mod panel;
|
|
mod poller;
|
|
mod settings;
|
|
mod theme;
|
|
mod tray_icon;
|
|
mod updater;
|
|
|
|
fn main() {
|
|
let args: Vec<String> = std::env::args().collect();
|
|
let diagnose_enabled = args.iter().any(|a| a == "--diagnose");
|
|
if diagnose_enabled {
|
|
if let Ok(path) = diagnose::init() {
|
|
diagnose::log(format!(
|
|
"startup args={args:?} log_path={}",
|
|
path.display()
|
|
));
|
|
}
|
|
}
|
|
|
|
if let Some(exit_code) = updater::handle_cli_mode(&args) {
|
|
if diagnose_enabled {
|
|
diagnose::log(format!("cli mode exited with code {exit_code}"));
|
|
}
|
|
std::process::exit(exit_code);
|
|
}
|
|
|
|
if diagnose_enabled {
|
|
diagnose::log("entering app::run");
|
|
}
|
|
app::run();
|
|
}
|