From 918536e4df5e6f0f86dcf4ae9fa508210d55c20f Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sat, 1 Mar 2025 14:33:42 -0500 Subject: [PATCH] more padding --- driveAtlas.sh | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/driveAtlas.sh b/driveAtlas.sh index ee77a1a..a5d447d 100644 --- a/driveAtlas.sh +++ b/driveAtlas.sh @@ -141,47 +141,42 @@ generate_medium2_layout() { done # Add padding for box borders - box_width=$((max_width + 2)) + box_width=$((max_width + 4)) - # Create dynamic box borders - box_top=$(printf "┌%${box_width}s┐" | tr ' ' '─') - box_bottom=$(printf "└%${box_width}s┘" | tr ' ' '─') + # Create box drawing elements + h_line=$(printf '%*s' "$box_width" '' | tr ' ' '─') # USB Section printf "\n External USB [0b:00.0]\n" - printf " %s %s\n" "$box_top" "$box_top" + printf " ┌%s┐ ┌%s┐\n" "$h_line" "$h_line" printf " │ %-${max_width}s │ │ %-${max_width}s │\n" "${DRIVE_MAP[usb1]:-EMPTY}" "${DRIVE_MAP[usb2]:-EMPTY}" - printf " %s %s\n\n" "$box_bottom" "$box_bottom" + printf " └%s┘ └%s┘\n\n" "$h_line" "$h_line" # Main chassis section printf "┌──────────────────────────────────────────────────────────────┐\n" printf "│ B650D4U3-2Q/BCM │\n" printf "│ │\n" printf "│ NVMe [0d:00.0] Bay 11 │\n" - printf "│ %s │\n" "$box_top" + printf "│ ┌%s┐ │\n" "$h_line" printf "│ │ %-${max_width}s │ │\n" "${DRIVE_MAP[11]:-EMPTY}" - printf "│ %s │\n" "$box_bottom" + printf "│ └%s┘ │\n" "$h_line" printf "│ │\n" printf "│ Front Hot-swap Bays [0c:00.0] │\n" - # Create dynamic box tops for all bays + # Create bay rows printf "│ " for bay in {1..10}; do - printf "%s" "$box_top" + printf "┌%s┐" "$h_line" done - printf " │\n" + printf " │\n│ " - # Create bay labels with drives - printf "│ " for bay in {1..10}; do printf "│%-2d:%-${max_width}s │" "$bay" "${DRIVE_MAP[$bay]:-EMPTY}" done - printf " │\n" + printf " │\n│ " - # Create dynamic box bottoms for all bays - printf "│ " for bay in {1..10}; do - printf "%s" "$box_bottom" + printf "└%s┘" "$h_line" done printf " │\n"