Compare commits

..

No commits in common. "main" and "v0.1.1" have entirely different histories.
main ... v0.1.1

7 changed files with 10 additions and 75 deletions

42
.gitattributes vendored
View file

@ -1,42 +0,0 @@
# Always check out source files with LF endings, regardless of the user's
# core.autocrlf setting. Without this, Windows clones with core.autocrlf=true
# (the Git-for-Windows default) treat every text file as "modified" because
# Git's stored version is LF but the working copy is CRLF.
* text=auto eol=lf
# Explicit text files (belt-and-suspenders).
*.rs text eol=lf
*.toml text eol=lf
*.json text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.js text eol=lf
*.svelte text eol=lf
*.css text eol=lf
*.html text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
# Shell + Windows scripts keep their native endings.
*.sh text eol=lf
*.ps1 text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
# Binaries — never touch these.
*.png binary
*.ico binary
*.icns binary
*.jpg binary
*.jpeg binary
*.gif binary
*.exe binary
*.dll binary
*.so binary
*.dylib binary
*.woff binary
*.woff2 binary
*.ttf binary
*.otf binary

9
.gitignore vendored
View file

@ -48,15 +48,6 @@ src-tauri/Cargo.lock
*.tsbuildinfo
.vite/
# Extra outputs from `pnpm tauri icon` — we ship only the canonical set
# (32x32.png, 128x128.png, 128x128@2x.png, icon.ico, icon.icns).
src-tauri/icons/64x64.png
src-tauri/icons/icon.png
src-tauri/icons/Square*.png
src-tauri/icons/StoreLogo.png
src-tauri/icons/android/
src-tauri/icons/ios/
# Agent working files — meaningful to local Claude Code sessions, noise for
# anyone else. Kept out of the public repo (they still live on disk).
CLAUDE.md

View file

@ -1,7 +1,7 @@
{
"name": "claude-usage-widget",
"private": true,
"version": "0.1.2",
"version": "0.1.1",
"type": "module",
"scripts": {
"dev": "vite",

View file

@ -1,6 +1,6 @@
[package]
name = "claude-usage-widget"
version = "0.1.2"
version = "0.1.1"
description = "Always-on-top Windows widget visualizing local Claude Code usage"
authors = ["megaproxy"]
edition = "2021"

View file

@ -114,8 +114,9 @@ pub fn autodetect_command() -> Option<Vec<String>> {
}
fn which_exists(name: &str) -> bool {
use std::process::Command;
let probe = if cfg!(windows) { "where" } else { "which" };
crate::paths::quiet_command(probe)
Command::new(probe)
.arg(name)
.output()
.map(|o| o.status.success() && !o.stdout.is_empty())
@ -123,7 +124,8 @@ fn which_exists(name: &str) -> bool {
}
fn list_wsl_distros() -> Vec<String> {
let Ok(out) = crate::paths::quiet_command("wsl.exe").args(["-l", "-q"]).output() else {
use std::process::Command;
let Ok(out) = Command::new("wsl.exe").args(["-l", "-q"]).output() else {
return Vec::new();
};
if !out.status.success() {
@ -143,7 +145,8 @@ fn list_wsl_distros() -> Vec<String> {
}
fn probe_claude_in_wsl(distro: &str) -> bool {
crate::paths::quiet_command("wsl.exe")
use std::process::Command;
Command::new("wsl.exe")
.args(["-d", distro, "bash", "-lc", "command -v claude"])
.output()
.map(|o| o.status.success() && !o.stdout.is_empty())

View file

@ -10,23 +10,6 @@
use serde::Serialize;
use std::path::{Path, PathBuf};
/// Construct a `Command` that won't flash a console window on Windows.
///
/// `Command::new(...).output()` allocates a console for the child process
/// before it exits, which appears as a black flash for short-lived processes
/// like `wsl.exe -l -q` or `where claude`. The CREATE_NO_WINDOW flag (Win32
/// process-creation flag 0x08000000) suppresses that.
pub fn quiet_command(program: &str) -> std::process::Command {
let mut c = std::process::Command::new(program);
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x08000000;
c.creation_flags(CREATE_NO_WINDOW);
}
c
}
#[derive(Debug, Clone, Serialize)]
pub struct ResolvedRoots {
pub roots: Vec<PathBuf>,
@ -41,7 +24,7 @@ pub fn list_wsl_distros() -> anyhow::Result<Vec<String>> {
return Ok(Vec::new());
}
let out = match quiet_command("wsl.exe")
let out = match std::process::Command::new("wsl.exe")
.args(["-l", "-q"])
.output()
{

View file

@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Claude Usage Widget",
"version": "0.1.2",
"version": "0.1.1",
"identifier": "com.megaproxy.claude-usage-widget",
"build": {
"beforeDevCommand": "pnpm dev",