mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
more refactoring
This commit is contained in:
parent
186f1ced0b
commit
887c559ca8
36
inxi
36
inxi
|
@ -1107,12 +1107,12 @@ print_networking_data()
|
|||
|
||||
print_it_out()
|
||||
{
|
||||
local hostName=$( hostname )
|
||||
local hostName=$( hostname ) i=''
|
||||
|
||||
# (IF VERBOSITY_LEVEL > 1)
|
||||
if ((VERBOSITY_LEVEL))
|
||||
if [ "$VERBOSITY_LEVEL" -gt 0 ]
|
||||
then
|
||||
if ((SHOW_HOST))
|
||||
if [ "$SHOW_HOST" -gt 0 ]
|
||||
then
|
||||
LNINTRO=$( printf "${C1}%-${INDENT}s${C2} \"%s\"${C1} %s " "Host/Kernel/OS" "$hostName" "running" )
|
||||
else
|
||||
|
@ -1148,26 +1148,26 @@ print_it_out()
|
|||
unset CPUNUM
|
||||
fi
|
||||
LNCPU=$( printf "${C1}%-${INDENT}s${C2} %s" "CPU Info" "${CPUNUM}${CPUNUM+ }${CPUTMP[0]}" )
|
||||
if [[ $VERBOSITY_LEVEL -ge 3 ]]
|
||||
if [ "$VERBOSITY_LEVEL" -ge 3 ]
|
||||
then
|
||||
LNCPU=$( printf "%s${C2} %s %s ${C1}%s${CN}%s${C2} %s ${CN}%s" "$LNCPU" "${CPUTMP[2]}" "cache" "flags" "(" "$CPUFLAGS" ")" )
|
||||
fi
|
||||
LNCPU=$( printf "%s ${C1}%s${C2} ${CN}%s${C2} %s ${CN}%s" "$LNCPU" "clocked at" "[" "${CPUTMP[1]} MHz" "]" )
|
||||
print_screen_output "$LNCPU"
|
||||
|
||||
for (( I=1; I < ${#CPU[@]}-1; I++))
|
||||
for (( i=1; i < ${#CPU[@]}-1; i++ ))
|
||||
do
|
||||
IFS=","
|
||||
CPUTMP=(${CPU[I]})
|
||||
CPUTMP=(${CPU[i]})
|
||||
IFS="$OIFS"
|
||||
LNCPU=$( printf "${C1}%-${INDENT}s${C2} %s" " " "($((I+1))) ${CPUTMP[0]}" )
|
||||
LNCPU=$( printf "${C1}%-${INDENT}s${C2} %s" " " "($((i+1))) ${CPUTMP[0]}" )
|
||||
if [[ $VERBOSITY_LEVEL -ge 3 ]]
|
||||
then
|
||||
LNCPU=$( printf "%s${C2} %s %s ${C1}%s${CN}%s${C2} %s ${CN}%s" "$LNCPU" "${CPUTMP[2]}" "cache" "flags" "(" "$CPUFLAGS" ")" )
|
||||
fi
|
||||
LNCPU=$( printf "%s ${C1}%s${C2} ${CN}%s${C2} %s ${CN}%s" "$LNCPU" "clocked at" "[" "${CPUTMP[1]} MHz" "]" )
|
||||
print_screen_output "$LNCPU"
|
||||
if [[ $I -gt 10 ]]
|
||||
if [[ $i -gt 10 ]]
|
||||
then
|
||||
break
|
||||
fi
|
||||
|
@ -1182,12 +1182,12 @@ print_it_out()
|
|||
fi
|
||||
|
||||
print_screen_output "$LNGFX"
|
||||
I=1
|
||||
while [[ -n ${GFX[I]} && $I -le 3 ]]
|
||||
i=1
|
||||
while [[ -n ${GFX[i]} && $i -le 3 ]]
|
||||
do
|
||||
LNGFX=$( printf "${C1}%-${INDENT}s${C2} %s" " " "${GFX[I]}" )
|
||||
LNGFX=$( printf "${C1}%-${INDENT}s${C2} %s" " " "${GFX[i]}" )
|
||||
print_screen_output "$LNGFX"
|
||||
(( I++ ))
|
||||
(( i++ ))
|
||||
done
|
||||
|
||||
if [[ $VERBOSITY_LEVEL -ge 2 ]]
|
||||
|
@ -1232,22 +1232,22 @@ print_it_out()
|
|||
#set_color_scheme 12
|
||||
if ! ((IBSHELL))
|
||||
then
|
||||
for I in $C1 $C2 $CN
|
||||
for i in $C1 $C2 $CN
|
||||
do
|
||||
case "$I" in
|
||||
case "$i" in
|
||||
"$GREEN"|"$WHITE"|"$YELLOW"|"$CYAN") BGBLACK=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if ((BGBLACK))
|
||||
then
|
||||
for I in C1 C2 CN
|
||||
for i in C1 C2 CN
|
||||
do
|
||||
if [[ "${!I}" = "$NORMAL" ]]
|
||||
if [[ "${!i}" = "$NORMAL" ]]
|
||||
then
|
||||
declare $I="${!I}15,1"
|
||||
declare $i="${!i}15,1"
|
||||
else
|
||||
declare $I="${!I},1"
|
||||
declare $i="${!i},1"
|
||||
fi
|
||||
done
|
||||
#C1="${C1},1"; C2="${C2},1"; CN="${CN},1"
|
||||
|
|
Loading…
Reference in a new issue