remove ccusage from tmux status

This commit is contained in:
David Chen 2025-12-21 15:18:28 -08:00
parent 2c776c6716
commit 3602e03a67

View file

@ -32,7 +32,6 @@ hostname=$(hostname -s 2>/dev/null || hostname 2>/dev/null || printf 'host')
rainbarf_bg="#2e3440"
rainbarf_segment=""
rainbarf_toggle="${TMUX_RAINBARF:-1}"
ccusage_segment=""
case "$rainbarf_toggle" in
0|false|FALSE|off|OFF|no|NO)
@ -53,34 +52,17 @@ if [[ "$rainbarf_toggle" == "1" ]] && command -v rainbarf >/dev/null 2>&1; then
fi
fi
# ccusage-codex today cost (cached)
ccusage_output=$(bash "$HOME/.config/tmux/tmux-status/ccusage-today.sh" 2>/dev/null || true)
if [[ -n "$ccusage_output" ]]; then
# Connect from previous segment if present, else from status-bg
connector_bg="$status_bg"
if [[ -n "$rainbarf_segment" ]]; then
connector_bg="$rainbarf_bg"
fi
ccusage_segment=$(printf '#[fg=%s,bg=%s]%s#[fg=%s,bg=%s] %s ' \
"$segment_bg" "$connector_bg" "$separator" \
"$segment_fg" "$segment_bg" "$ccusage_output")
fi
# Build a connector into the hostname segment using host colors
host_connector_bg="$status_bg"
if [[ -n "$rainbarf_segment" ]]; then
host_connector_bg="$rainbarf_bg"
fi
if [[ -n "$ccusage_segment" ]]; then
host_connector_bg="$segment_bg"
fi
host_prefix=$(printf '#[fg=%s,bg=%s]%s#[fg=%s,bg=%s] ' \
"$host_bg" "$host_connector_bg" "$separator" \
"$host_fg" "$host_bg")
printf '%s%s%s%s #[fg=%s,bg=%s]%s' \
printf '%s%s%s #[fg=%s,bg=%s]%s' \
"$rainbarf_segment" \
"$ccusage_segment" \
"$host_prefix" \
"$hostname" \
"$host_bg" "$status_bg" "$right_cap"