From 555ecd54b2e797153179cedd086d49ad03fc7a9d Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Fri, 6 Feb 2026 18:27:33 -0500 Subject: [PATCH] Fix 10-bay ASCII box alignment Border was 130 columns wide but bay lines were 138. Widened border and all interior format strings to match the bay content width (136 interior = 138 total). Long controller descriptions are now truncated to prevent overflow. Ref https://code.lotusguild.org/LotusGuild/driveAtlas/issues/25 Co-Authored-By: Claude Opus 4.6 --- driveAtlas.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/driveAtlas.sh b/driveAtlas.sh index 2c42e7e..8177baa 100644 --- a/driveAtlas.sh +++ b/driveAtlas.sh @@ -344,26 +344,29 @@ generate_10bay_layout() { # Fixed width for consistent box drawing (fits device names like "nvme0n1") local drive_width=10 + # Box interior width = 136 (determined by 10 bay boxes: 4 + 10*13 + 2) + # Total box width = 138 (136 interior + 2 for │ borders) + # Main chassis section - printf "┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐\n" - printf "│ %-126s │\n" "$hostname - Sliger CX4712 (10x 3.5\" Hot-swap)" - printf "│ │\n" + printf "┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐\n" + printf "│ %-132s │\n" "$hostname - Sliger CX4712 (10x 3.5\" Hot-swap)" + printf "│%-136s│\n" "" # Show storage controllers - printf "│ Storage Controllers: │\n" + printf "│ %-134s│\n" "Storage Controllers:" while IFS= read -r ctrl; do - [[ -n "$ctrl" ]] && printf "│ %-126s│\n" "$ctrl" + [[ -n "$ctrl" ]] && printf "│ %-134.134s│\n" "$ctrl" done < <(get_storage_controllers) - printf "│ │\n" + printf "│%-136s│\n" "" # M.2 NVMe slot if present if [[ -n "${DRIVE_MAP[m2-1]}" ]]; then - printf "│ M.2 NVMe: %-10s │\n" "${DRIVE_MAP[m2-1]}" - printf "│ │\n" + printf "│ %-134s│\n" " M.2 NVMe: ${DRIVE_MAP[m2-1]}" + printf "│%-136s│\n" "" fi - printf "│ Front Hot-swap Bays: │\n" - printf "│ │\n" + printf "│ %-134s│\n" " Front Hot-swap Bays:" + printf "│%-136s│\n" "" # Bay top borders printf "│ " @@ -386,7 +389,7 @@ generate_10bay_layout() { done printf " │\n" - printf "└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘\n" + printf "└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘\n" } #------------------------------------------------------------------------------