diff --git a/README.md b/README.md index b635dbc..e9c6716 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Shared shell and tool configuration. Tracked files: - `.zshrc` — shared zsh UI behavior -- `claude/statusline-command.sh` — Claude Code statusline (dir, branch, model, thinking, rate limits) This repo is intentionally small. Machine-specific setup stays local unless explicitly promoted into shared config later. @@ -18,13 +17,7 @@ This repo is intentionally small. Machine-specific setup stays local unless expl source "$HOME/Projekte/dotfiles/.zshrc" ``` -**Claude Code**: statusline symlink: - -```zsh -ln -s "$HOME/Projekte/dotfiles/claude/statusline-command.sh" ~/.claude/statusline-command.sh -``` - -Agent instructions, hooks, `.env.agents` and the agent SSH helpers moved to +Agent instructions, hooks, `.env.agents`, the Claude statusline and the agent SSH helpers moved to `~/Projekte/ai-config/agents/` on 2026-10-09 (`.zshrc` sources `agent-env.zsh` from there); see that folder's README for the wiring. diff --git a/claude/statusline-command.sh b/claude/statusline-command.sh deleted file mode 100755 index 1103a5c..0000000 --- a/claude/statusline-command.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash -input=$(cat) -cwd=$(echo "$input" | jq -r '.workspace.current_dir // .cwd') -dir=$(basename "$cwd") -model=$(echo "$input" | jq -r '.model.display_name // ""') - -# Git branch (skip optional locks) -branch=$(git -C "$cwd" symbolic-ref --quiet --short HEAD 2>/dev/null) - -# Context usage -used=$(echo "$input" | jq -r '.context_window.used_percentage // empty') - -# Rate limits -rl_5h=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty') -rl_5h_reset=$(echo "$input" | jq -r '.rate_limits.five_hour.resets_at // empty') -rl_7d=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty') -rl_7d_reset=$(echo "$input" | jq -r '.rate_limits.seven_day.resets_at // empty') - -# Whole hours until a unix-epoch timestamp, ceiling-rounded; falls back to label on past/empty -hours_until() { - local ts="$1" fallback="$2" - [[ -z "$ts" ]] && { printf '%s' "$fallback"; return; } - local diff=$(( ts - $(date +%s) )) - (( diff <= 0 )) && { printf '%s' "$fallback"; return; } - printf '%dh' "$(( (diff + 3599) / 3600 ))" -} - -# Same idea, days -days_until() { - local ts="$1" fallback="$2" - [[ -z "$ts" ]] && { printf '%s' "$fallback"; return; } - local diff=$(( ts - $(date +%s) )) - (( diff <= 0 )) && { printf '%s' "$fallback"; return; } - printf '%dd' "$(( (diff + 86399) / 86400 ))" -} - -# Render a percentage with optional suffix; yellow >=80, red >=90. \e[39m restores default fg without dropping the surrounding dim. -pct_color() { - local val="$1" suffix="$2" int color='' - int=${val%.*} - (( int >= 90 )) && color=$'\e[31m' - (( int >= 80 && int < 90 )) && color=$'\e[33m' - if [[ -n "$color" ]]; then - printf '%s%.0f%%%s\e[39m' "$color" "$val" "$suffix" - else - printf '%.0f%%%s' "$val" "$suffix" - fi -} - -# Thinking / effort -thinking=$(echo "$input" | jq -r '.thinking.enabled // empty') -effort=$(echo "$input" | jq -r '.effort.level // empty') - -# Build dim suffix -dim="" -[[ -n "$branch" ]] && dim="$dim ($branch)" -[[ -n "$model" ]] && dim="$dim $model" -[[ -n "$effort" ]] && dim="$dim $effort" -[[ -z "$effort" && -n "$thinking" ]] && dim="$dim thinking" -[[ -n "$used" ]] && dim="$dim $(pct_color "$used")" - -usage="" -[[ -n "$rl_5h" ]] && usage="$usage $(pct_color "$rl_5h" "/$(hours_until "$rl_5h_reset" 5h)")" -[[ -n "$rl_7d" ]] && usage="$usage $(pct_color "$rl_7d" "/$(days_until "$rl_7d_reset" 7d)")" -[[ -n "$usage" ]] && dim="$dim -$usage" - -printf '\033[1m%s\033[0m\033[2m%s\033[0m\n' "$dir" "$dim"