diff --git a/inxi b/inxi index 5a77418..56e8dd9 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,13 @@ #!/bin/bash ######################################################################## #### Script Name: inxi +<<<<<<< .mine +#### version: 1.1.12 +#### Date: August 6 2009 +======= #### version: 1.1.12 #### Date: August 4 2009 +>>>>>>> .r685 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -3931,8 +3936,8 @@ print_gfx_data() print_hard_disk_data() { eval $LOGFS - local hdd_data='' hdd_data_2='' a_hdd_working='' hdd_temp_data='' - local dev_data='' size_data='' hdd_model='' hdd_model_2='' hdd_model_3='' usb_data='' + local hdd_data='' hdd_data_2='' a_hdd_working='' hdd_temp_data='' hdd_string='' + local dev_data='' size_data='' hdd_model='' usb_data='' hdd_name='' # load A_HDD_DATA get_hdd_data_basic @@ -3962,6 +3967,7 @@ print_hard_disk_data() fi dev_data="/dev/${a_hdd_working[0]} " size_data=" ${a_hdd_working[1]}" + hdd_name="${a_hdd_working[2]}" fi if [[ $B_EXTRA_DATA == 'true' && -n $dev_data ]];then @@ -3969,31 +3975,42 @@ print_hard_disk_data() # error handling is done in get data function if [[ -n $hdd_temp_data ]];then hdd_temp_data=" ${hdd_temp_data}C" + else + hdd_temp_data='' fi fi - # wrap to avoid long lines - if [[ $i -gt 1 && $B_SHOW_DISK == 'true' ]] || [[ $i -gt 3 ]];then - hdd_model_2="${hdd_model_2}${hdd_model_2+${C1}$(($i+1)):${C2}} $usb_data$dev_data${a_hdd_working[2]}$size_data$hdd_temp_data " - else - hdd_model="${hdd_model}${hdd_model+ ${C1}$(($i+1)):${C2}} $usb_data$dev_data${a_hdd_working[2]}$size_data$hdd_temp_data" + + if [[ $B_SHOW_DISK == 'true' ]];then + hdd_string="$usb_data$dev_data$hdd_name$size_data$hdd_temp_data" + hdd_model="${hdd_model}${C1}$(($i+1)):${C2} $hdd_string " + # printing line one, then every other line, and after, if leftovers, print that line. + case $i in + 0) + hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2} ${C1}Total Size:${C2} ${hdd_capacity} (${hdd_used}) ${hdd_model}" ) + print_screen_output "$hdd_data" + hdd_model='' + ;; + *) + # using modulus here, if divisible by 2, print line, otherwise skip + if [[ $(( $i % 2 )) -eq 0 ]];then + hdd_data=$( create_print_line " " "${hdd_model}${CN}" ) + print_screen_output "$hdd_data" + hdd_model='' + fi + ;; + esac fi done - if [[ -z $hdd_model ]];then - hdd_model=' None Detected' - fi - if [[ -n $hdd_model_2 ]];then - hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2} ${C1}Total Size:${C2} ${hdd_capacity} (${hdd_used})${hdd_model}" ) - hdd_data_2=$( create_print_line " " "${hdd_model_2}${CN}" ) - else - hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2} ${C1}Total Size:${C2} ${hdd_capacity} (${hdd_used})${hdd_model}${CN}" ) + # then print any leftover items + if [[ -n $hdd_model ]];then + hdd_data=$( create_print_line " " "${hdd_model}${CN}" ) + print_screen_output "$hdd_data" fi else hdd_data=$( create_print_line "Disks:" "${C1}HDD Total Size:${C2} ${hdd_capacity} (${hdd_used})${CN}" ) + print_screen_output "$hdd_data" fi - print_screen_output "$hdd_data" - if [[ -n $hdd_model_2 ]];then - print_screen_output "$hdd_data_2" - fi + eval $LOGFE }