diff --git a/home-configs/claude/statusline-command.sh b/home-configs/claude/statusline-command.sh index 09627f2..eeffdb8 100644 --- a/home-configs/claude/statusline-command.sh +++ b/home-configs/claude/statusline-command.sh @@ -22,9 +22,12 @@ fmt_remaining() { now=$(date +%s) local diff=$(( reset_ts - now )) [ "$diff" -le 0 ] && echo "скоро" && return - local h=$(( diff / 3600 )) + local d=$(( diff / 86400 )) + local h=$(( (diff % 86400) / 3600 )) 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}м" else echo "${m}м" @@ -37,10 +40,13 @@ if [[ "$model" == *[Dd]eep[Ss]eek* ]]; then balance=$(head -1 "$cache_file") [ -n "$balance" ] && printf " \033[00;35m\$%s\033[00m" "$balance" fi -elif [ -n "$five_pct" ] && [ -n "$five_reset" ]; then - remaining=$(fmt_remaining "$five_reset") - printf " \033[00;35m%s:$(printf '%.0f' "$five_pct")%%\033[00m" "$remaining" -elif [ -n "$week_pct" ] && [ -n "$week_reset" ]; then - remaining=$(fmt_remaining "$week_reset") - printf " \033[00;35m%s:$(printf '%.0f' "$week_pct")%%\033[00m" "$remaining" +else + if [ -n "$five_pct" ] && [ -n "$five_reset" ]; then + remaining=$(fmt_remaining "$five_reset") + printf " \033[00;35m%s:$(printf '%.0f' "$five_pct")%%\033[00m" "$remaining" + fi + if [ -n "$week_pct" ] && [ -n "$week_reset" ]; then + remaining=$(fmt_remaining "$week_reset") + printf " \033[00;35m%s:$(printf '%.0f' "$week_pct")%%\033[00m" "$remaining" + fi fi