feat: добавить настройку статусной строки Claude Code
Шаг 6.7 - копирует statusline-command.sh и прописывает statusLine в settings.json. Показывает user@host, путь, git-ветку, модель и usage%. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
33
ai-setup.sh
33
ai-setup.sh
@@ -638,7 +638,36 @@ else
|
||||
info "Папка со skills не найдена, пропускаю"
|
||||
fi
|
||||
|
||||
# ── 6.7. Регистрация официального маркетплейса плагинов Claude ──
|
||||
# ── 6.7. Статусная строка Claude Code ───────────────────────
|
||||
info "Настраиваю статусную строку Claude Code..."
|
||||
STATUSLINE_SRC="$SCRIPT_DIR/home-configs/claude/statusline-command.sh"
|
||||
STATUSLINE_DST="$HOME/.claude/statusline-command.sh"
|
||||
if [ -f "$STATUSLINE_SRC" ]; then
|
||||
cp "$STATUSLINE_SRC" "$STATUSLINE_DST"
|
||||
chmod +x "$STATUSLINE_DST"
|
||||
# Вписываем statusLine в settings.json через python3
|
||||
SETTINGS="$HOME/.claude/settings.json"
|
||||
python3 - "$SETTINGS" "$STATUSLINE_DST" <<'PYEOF'
|
||||
import sys, json, os
|
||||
settings_path, script_path = sys.argv[1], sys.argv[2]
|
||||
data = {}
|
||||
if os.path.exists(settings_path):
|
||||
with open(settings_path) as f:
|
||||
try:
|
||||
data = json.load(f)
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
data["statusLine"] = {"type": "command", "command": f"bash {script_path}"}
|
||||
with open(settings_path, "w") as f:
|
||||
json.dump(data, f, indent=2, ensure_ascii=False)
|
||||
f.write("\n")
|
||||
PYEOF
|
||||
success "Статусная строка настроена"
|
||||
else
|
||||
warn "Файл $STATUSLINE_SRC не найден, пропускаю"
|
||||
fi
|
||||
|
||||
# ── 6.8. Регистрация официального маркетплейса плагинов Claude ──
|
||||
info "Настраиваю маркетплейс плагинов Claude Code..."
|
||||
if ! command -v claude &>/dev/null; then
|
||||
warn "claude не найден, пропускаю настройку маркетплейса"
|
||||
@@ -667,7 +696,7 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# ── 6.8. Установка Claude Notifier ──────────────────────────
|
||||
# ── 6.9. Установка Claude Notifier ──────────────────────────
|
||||
info "Устанавливаю Claude Notifier..."
|
||||
if [ -f "$HOME/.claude/hooks/claude-notifier-on-stop.js" ]; then
|
||||
success "Claude Notifier уже установлен"
|
||||
|
||||
Reference in New Issue
Block a user