From 9448212a26937e047b19e6554768764dddcadb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=9D=D0=B8?= =?UTF-8?q?=D0=BA=D0=B8=D1=82=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Fri, 21 Aug 2026 15:41:55 +0300 Subject: [PATCH] =?UTF-8?q?fix(deepseek):=20USD-only=20balance=20display,?= =?UTF-8?q?=20drop=20CNY/=C2=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Launcher and statusline show only USD from balance_infos; ¥ removed. Co-Authored-By: Claude --- home-configs/claude/README.md | 2 +- home-configs/claude/statusline-command.sh | 7 +++---- scripts/ai-setup.sh | 15 +++++++-------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/home-configs/claude/README.md b/home-configs/claude/README.md index 1ca2a52..3825fe2 100644 --- a/home-configs/claude/README.md +++ b/home-configs/claude/README.md @@ -6,7 +6,7 @@ The custom statusline script renders **only ASCII-safe characters and ANSI color - ASCII brackets `[ ]` for git branch and effort level - ANSI 256-color escape sequences for model names, effort levels, and rate-limit percentages -- The `¥` symbol (U+00A5) for CNY balance in DeepSeek output +- The `$` symbol for the DeepSeek balance (USD only) It does **not** use Nerd Font glyphs, powerline separators, or emoji. diff --git a/home-configs/claude/statusline-command.sh b/home-configs/claude/statusline-command.sh index 92e55f2..624fde0 100755 --- a/home-configs/claude/statusline-command.sh +++ b/home-configs/claude/statusline-command.sh @@ -171,13 +171,12 @@ if [[ "$model_id" == *deepseek* ]]; then import sys, json d = json.load(sys.stdin) infos = d.get('balance_infos', []) -symbols = {'USD': '\$', 'CNY': '\u00a5'} parts = [] for info in infos: - curr = info.get('currency', '') + if info.get('currency', '').upper() != 'USD': + continue total = info.get('total_balance', '0') - sym = symbols.get(curr, curr) - parts.append(f'{sym}{total}') + parts.append(f'\${total}') if parts: print(' '.join(parts)) " 2>/dev/null) diff --git a/scripts/ai-setup.sh b/scripts/ai-setup.sh index e91740d..77fc7f8 100755 --- a/scripts/ai-setup.sh +++ b/scripts/ai-setup.sh @@ -706,25 +706,24 @@ try: d = json.load(sys.stdin) available = d.get('is_available', False) infos = d.get('balance_infos', []) + # Показываем только USD (CNY не выводим) + infos = [i for i in infos if i.get('currency', '').upper() == 'USD'] if not infos: print(' \033[0;33m[БАЛАНС]\033[0m Нет данных о балансе') sys.exit(0) - symbols = {'USD': '\$', 'CNY': '¥'} cache_parts = [] for info in infos: - curr = info.get('currency', '???') total = info.get('total_balance', '0') granted = info.get('granted_balance', '0') topped_up = info.get('topped_up_balance', '0') - sym = symbols.get(curr, curr) status = '✅ доступен' if available else '❌ не активен' - print(f' \033[1;36m💰 Баланс DeepSeek:\033[0m {total} {curr} {status}') + print(f' \033[1;36m💰 Баланс DeepSeek:\033[0m \${total} {status}') if float(granted) > 0: - print(f' └─ Начислено: {granted} {curr}') + print(f' └─ Начислено: \${granted}') if float(topped_up) > 0: - print(f' └─ Пополнено: {topped_up} {curr}') - cache_parts.append(f'{sym}{total}') - # Cache all currencies with symbols for statusline + print(f' └─ Пополнено: \${topped_up}') + cache_parts.append(f'\${total}') + # Cache USD balance for statusline if cache_parts: cache_dir = os.path.expanduser('~/.cache/ai-setup') os.makedirs(cache_dir, exist_ok=True)