Skip to content

Commit

Permalink
fine tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
mtekman committed Nov 1, 2022
1 parent 809a0f6 commit 6c1efdd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dietpi/func/dietpi-banner
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
title=$(echo "$stripped_title" | fold -s -w $TERM_WIDTH)
title="${title//$'\n'/$'\n' }"
title="${aCOLOUR[1]}${title}$COLOUR_RESET"
title_len=$(( (($title_len + 3) % $TERM_WIDTH) + 3 )) ## leftover minus paddding
## Recalculate the title length based on the last line with padding
title_len=$(( (($title_len + 3) % $TERM_WIDTH) + 3 ))
fi

local avail_len=$(( ($TERM_WIDTH - $title_len) - 1))
Expand All @@ -131,7 +132,7 @@
## The description is typically very long, and is folded from the second line
## onwards into the remaining available space, with left padding.
if (( $descp_len >= $avail_len )); then
descp=$(echo ""$stripped_descp"" | fold -s -w $avail_len)
descp=$(echo "$stripped_descp" | fold -s -w $avail_len)
descp="${descp//$'\n'/$'\n'${left_pad}}"
fi
fi
Expand Down

0 comments on commit 6c1efdd

Please sign in to comment.