added nvme and usb back

This commit is contained in:
2025-03-01 12:17:43 -05:00
parent a6cb3400be
commit 81d7d17370

View File

@ -91,40 +91,45 @@ generate_medium2_layout() {
local sata_drives=$(ls -l /dev/disk/by-path/pci-0000:0c:00.0-ata-[0-9]$ 2>/dev/null | awk -F'/' '{print $NF}')
local nvme_drive=$(ls -l /dev/disk/by-path/pci-0000:0d:00.0* 2>/dev/null | awk -F'/' '{print $NF}')
printf "┌──────────────────────────────────────────────────────────────┐\n"
printf "│ │\n"
printf "│ │\n"
printf " │\n"
printf " \n"
printf "│ medium2 │\n"
printf "│ │\n"
printf "│ │\n"
printf "│ │\n"
printf "│ ┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐ │\n"
# Print USB section
printf " External USB [0b:00.0]\n"
printf " ┌────┐ ┌────┐\n"
printf " │%-4s│ │%-4s│\n" "$(echo "$usb_drives" | grep "sdf" || echo "")" "$(echo "$usb_drives" | grep "sde" || echo "")"
printf " └────┘ └────┘\n\n"
# Print drive info in vertical layout
for row in {1..8}; do
printf "┌──────────────────────────────────────────────────────────────┐\n"
printf "│ B650D4U3-2Q/BCM │\n"
printf "│ │\n"
printf "│ NVMe [0d:00.0] │\n"
printf "│ ┌────┐ │\n"
printf "│ │%-4s│ │\n" "$(echo "$nvme_drive" | cut -c1-4)"
printf "│ └────┘ │\n"
printf "│ │\n"
printf "│ Front Hot-swap Bays [0c:00.0] │\n"
# Print SATA drive bays
printf "│ ┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐ │\n"
for row in {1..6}; do
printf "│ "
for bay in {1..10}; do
local drive=$(echo "$sata_drives" | grep "ata-$bay" || echo "")
if [ $row -eq 4 ]; then
if [ $row -eq 3 ]; then
printf "│%-4s│" "$drive"
elif [ $row -eq 4 ]; then
printf "│ %-3d │" "$bay"
elif [ -n "$drive" ] && [ $row -eq 5 ]; then
local smart_info=$(get_drive_smart_info "$drive")
printf "│ %-3s │" "${smart_info:0:3}"
local size=$(get_drive_details "$drive")
printf "│%-4s│" "$size"
else
printf "│ │"
fi
done
printf " │\n"
done
printf "│ └────┘└────┘└────┘└────┘└────┘└────┘└────┘└────┘└────┘└────┘ │\n"
printf "│ │\n"
printf "└──────────────────────────────────────────────────────────────┘\n"
}
microGeneric='''
┌─┐ ┌─┐
┌└─┘──└─┘┐