last tweaks

This commit is contained in:
inxi-svn 2008-12-03 22:24:19 +00:00
parent ddb7fff801
commit eb1dc02ed5

23
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.7.1-b1-t4 #### version: 0.7.1-b1-t5
#### Date: December 3 2008 #### Date: December 3 2008
######################################################################## ########################################################################
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif #### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
@ -2621,9 +2621,9 @@ print_partition_data()
{ {
local a_partition_working='' partition_used='' swap='' partition_data='' partition_data_2='' local a_partition_working='' partition_used='' swap='' partition_data='' partition_data_2=''
local partition_data_3='' partition_data_4='' partition_data_5='' partition_data_6='' local partition_data_3='' partition_data_4='' partition_data_5='' partition_data_6=''
local partition_data_7='' counter=1 line_max=150 local partition_data_7='' partition_data_8='' counter=1 line_max=150
# this handles the different irc colors strings embedded in variable data # this handles the different, shorter, irc colors strings embedded in variable data
if [[ $B_RUNNING_IN_SHELL != 'true' ]];then if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
line_max=130 line_max=130
fi fi
@ -2652,14 +2652,12 @@ print_partition_data()
case $counter in case $counter in
1) 1)
partition_data="$partition_data${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used " partition_data="$partition_data${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
# echo 1 $( wc -c <<< $partition_data )
if [[ $( wc -c <<< $partition_data ) -gt $line_max ]];then if [[ $( wc -c <<< $partition_data ) -gt $line_max ]];then
counter=2 counter=2
fi fi
;; ;;
2) 2)
partition_data_2="$partition_data_2${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used " partition_data_2="$partition_data_2${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
# echo 2 $( wc -c <<< $partition_data_2 )
if [[ $( wc -c <<< $partition_data_2 ) -gt $line_max ]];then if [[ $( wc -c <<< $partition_data_2 ) -gt $line_max ]];then
counter=3 counter=3
fi fi
@ -2688,14 +2686,23 @@ print_partition_data()
counter=7 counter=7
fi fi
;; ;;
*) 7)
partition_data_7="$partition_data_7${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used " partition_data_7="$partition_data_7${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
if [[ $( wc -c <<< $partition_data_7 ) -gt $line_max ]];then
counter=8
fi
;;
*)
partition_data_8="$partition_data_8${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
;; ;;
esac esac
fi fi
done done
# create the first line
partition_data=$( create_print_line "Partition:" "$partition_data" ) partition_data=$( create_print_line "Partition:" "$partition_data" )
print_screen_output "$partition_data" print_screen_output "$partition_data"
# then the rest, if required
if [[ -n $partition_data_2 ]];then if [[ -n $partition_data_2 ]];then
partition_data_2=$( create_print_line " " "$partition_data_2" ) partition_data_2=$( create_print_line " " "$partition_data_2" )
print_screen_output "$partition_data_2" print_screen_output "$partition_data_2"
@ -2720,6 +2727,10 @@ print_partition_data()
partition_data_7=$( create_print_line " " "$partition_data_7" ) partition_data_7=$( create_print_line " " "$partition_data_7" )
print_screen_output "$partition_data_7" print_screen_output "$partition_data_7"
fi fi
if [[ -n $partition_data_8 ]];then
partition_data_8=$( create_print_line " " "$partition_data_8" )
print_screen_output "$partition_data_8"
fi
} }
print_system_data() print_system_data()