feat: показывать оба лимита в статусной строке (5ч и 7д)

Вместо одного показываются оба: "4ч20м:1% 5д3ч:4%".
Для недельного добавлен формат дней: "5д3ч".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-06 12:48:26 +03:00
parent 6b80364344
commit 08be1dfc08

View File

@@ -22,9 +22,12 @@ fmt_remaining() {
now=$(date +%s) now=$(date +%s)
local diff=$(( reset_ts - now )) local diff=$(( reset_ts - now ))
[ "$diff" -le 0 ] && echo "скоро" && return [ "$diff" -le 0 ] && echo "скоро" && return
local h=$(( diff / 3600 )) local d=$(( diff / 86400 ))
local h=$(( (diff % 86400) / 3600 ))
local m=$(( (diff % 3600) / 60 )) local m=$(( (diff % 3600) / 60 ))
if [ "$h" -gt 0 ]; then if [ "$d" -gt 0 ]; then
echo "${d}д${h}ч"
elif [ "$h" -gt 0 ]; then
echo "${h}ч${m}м" echo "${h}ч${m}м"
else else
echo "${m}м" echo "${m}м"
@@ -37,10 +40,13 @@ if [[ "$model" == *[Dd]eep[Ss]eek* ]]; then
balance=$(head -1 "$cache_file") balance=$(head -1 "$cache_file")
[ -n "$balance" ] && printf " \033[00;35m\$%s\033[00m" "$balance" [ -n "$balance" ] && printf " \033[00;35m\$%s\033[00m" "$balance"
fi fi
elif [ -n "$five_pct" ] && [ -n "$five_reset" ]; then else
if [ -n "$five_pct" ] && [ -n "$five_reset" ]; then
remaining=$(fmt_remaining "$five_reset") remaining=$(fmt_remaining "$five_reset")
printf " \033[00;35m%s:$(printf '%.0f' "$five_pct")%%\033[00m" "$remaining" printf " \033[00;35m%s:$(printf '%.0f' "$five_pct")%%\033[00m" "$remaining"
elif [ -n "$week_pct" ] && [ -n "$week_reset" ]; then fi
if [ -n "$week_pct" ] && [ -n "$week_reset" ]; then
remaining=$(fmt_remaining "$week_reset") remaining=$(fmt_remaining "$week_reset")
printf " \033[00;35m%s:$(printf '%.0f' "$week_pct")%%\033[00m" "$remaining" printf " \033[00;35m%s:$(printf '%.0f' "$week_pct")%%\033[00m" "$remaining"
fi fi
fi