mirror of
https://github.com/smxi/inxi.git
synced 2025-01-31 10:02:18 +00:00
Fixed long line wraps, rearranged hard disk info
This commit is contained in:
parent
eeacc5cdf5
commit
657173834f
21
inxi
21
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 0.4.2
|
#### version: 0.4.4
|
||||||
#### Date: November 7 2008
|
#### Date: November 7 2008
|
||||||
########################################################################
|
########################################################################
|
||||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||||
|
@ -1661,7 +1661,7 @@ print_gfx_data()
|
||||||
print_hard_disk_data()
|
print_hard_disk_data()
|
||||||
{
|
{
|
||||||
local hdd_data='' partition_data='' a_partition_working='' hdd_model='' a_hdd_working=''
|
local hdd_data='' partition_data='' a_partition_working='' hdd_model='' a_hdd_working=''
|
||||||
local dev_data='' size_data=''
|
local dev_data='' size_data='' hdd_model_2='' hdd_data_2=''
|
||||||
|
|
||||||
if [[ $VERBOSITY_LEVEL -ge 3 ]];then
|
if [[ $VERBOSITY_LEVEL -ge 3 ]];then
|
||||||
## note: the output part of this should be in the print hdd data function, not here
|
## note: the output part of this should be in the print hdd data function, not here
|
||||||
|
@ -1676,16 +1676,29 @@ print_hard_disk_data()
|
||||||
dev_data="/dev/${a_hdd_working[0]} - "
|
dev_data="/dev/${a_hdd_working[0]} - "
|
||||||
size_data=" - ${a_hdd_working[1]}"
|
size_data=" - ${a_hdd_working[1]}"
|
||||||
fi
|
fi
|
||||||
|
# wrap to avoid long lines
|
||||||
|
if [[ $i -gt 1 && $B_EXTRA_DATA == 'true' ]] || [[ $i -gt 3 ]];then
|
||||||
|
hdd_model_2="${hdd_model_2}${hdd_model_2+${C1}($(($i+1)))${C2}}$dev_data${a_hdd_working[2]}$size_data "
|
||||||
|
else
|
||||||
hdd_model="${hdd_model}${hdd_model+ ${C1}($(($i+1)))${C2}}$dev_data${a_hdd_working[2]}$size_data"
|
hdd_model="${hdd_model}${hdd_model+ ${C1}($(($i+1)))${C2}}$dev_data${a_hdd_working[2]}$size_data"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
if [[ -z $hdd_model ]];then
|
if [[ -z $hdd_model ]];then
|
||||||
hdd_model=' Non Detected'
|
hdd_model=' Non Detected'
|
||||||
fi
|
fi
|
||||||
hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2}${hdd_model} ${C1}Size${C2} ${hdd_capacity} (${hdd_used})${CN}" )
|
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
|
else
|
||||||
hdd_data=$( create_print_line "Disks:" "${C1}HDD Size${C2} ${hdd_capacity} (${hdd_used})${CN}" )
|
hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2} ${C1}Total Size:${C2} ${hdd_capacity} (${hdd_used})${hdd_model}${CN}" )
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
hdd_data=$( create_print_line "Disks:" "${C1}HDD Total Size:${C2} ${hdd_capacity} (${hdd_used})${CN}" )
|
||||||
fi
|
fi
|
||||||
print_screen_output "$hdd_data"
|
print_screen_output "$hdd_data"
|
||||||
|
if [[ -n $hdd_model_2 ]];then
|
||||||
|
print_screen_output "$hdd_data_2"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $VERBOSITY_LEVEL -ge 4 ]];then
|
if [[ $VERBOSITY_LEVEL -ge 4 ]];then
|
||||||
# set A_PARTITION_DATA
|
# set A_PARTITION_DATA
|
||||||
|
|
Loading…
Reference in a new issue