New version: fixed an old bug, with -c 0, no colors, RED and NORMAL

color codes were
not set to null, which results in some cases with red output, along with 
turning
terminal/console font color red.
This commit is contained in:
inxi-svn 2014-03-26 19:46:58 +00:00
parent 6556ae2375
commit f61487f0b7
2 changed files with 29 additions and 9 deletions

24
inxi
View file

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### Version: 2.1.10 #### Version: 2.1.11
#### Date: 2014-03-25 #### Date: 2014-03-26
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -797,10 +797,6 @@ main()
# then create the output # then create the output
print_it_out print_it_out
## last steps
if [[ $B_IRC == 'false' && $SCHEME -gt 0 ]];then
echo -n ""
fi
eval $LOGFE eval $LOGFE
# weechat's executor plugin forced me to do this, and rightfully so, because else the exit code # weechat's executor plugin forced me to do this, and rightfully so, because else the exit code
# from the last command is taken.. # from the last command is taken..
@ -822,9 +818,9 @@ initialize_data()
BSD_VERSION=$( uname -s 2>/dev/null | tr '[A-Z]' '[a-z]' ) BSD_VERSION=$( uname -s 2>/dev/null | tr '[A-Z]' '[a-z]' )
# note: archbsd says they are a freebsd distro, so assuming it's the same as freebsd # note: archbsd says they are a freebsd distro, so assuming it's the same as freebsd
if [[ -n $( grep 'bsd' <<< "$BSD_VERSION" ) ]];then if [[ -z ${BSD_VERSION/*bsd*/} ]];then
# GNU/kfreebsd will by definition have GNU tools like sed/grep # GNU/kfreebsd will by definition have GNU tools like sed/grep
if [[ -n $( grep 'kfreebsd' <<< "$BSD_VERSION" ) ]];then if [[ -z ${BSD_VERSION/*kfreebsd*/} ]];then
BSD_TYPE='debian-bsd' # debian gnu bsd BSD_TYPE='debian-bsd' # debian gnu bsd
else else
BSD_TYPE='bsd' # all other bsds BSD_TYPE='bsd' # all other bsds
@ -1106,6 +1102,11 @@ set_color_scheme()
C2="${!a_output_colors[1]}" C2="${!a_output_colors[1]}"
CN="${!a_output_colors[2]}" CN="${!a_output_colors[2]}"
# ((COLOR_SCHEME++)) ## note: why is this? ## # ((COLOR_SCHEME++)) ## note: why is this? ##
# handle some explicit colors that are used for no color 0
if [[ $SCHEME -eq 0 ]];then
NORMAL=''
RED=''
fi
eval $LOGFE eval $LOGFE
} }
@ -9028,6 +9029,11 @@ print_it_out()
print_info_data print_info_data
fi fi
fi fi
## last steps, clear any lingering colors
if [[ $B_IRC == 'false' && $SCHEME -gt 0 ]];then
echo -n ""
fi
eval $LOGFE eval $LOGFE
} }
@ -9162,7 +9168,7 @@ print_audio_data()
else else
alsa_version='N/A' alsa_version='N/A'
fi fi
alsa_data="${C1}Sound$SEP3${C2} $alsa ${C1}v:$SEP3${C2} $alsa_version" alsa_data="${C1}Sound$SEP3${C2} $alsa ${C1}v$SEP3${C2} $alsa_version"
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
fi fi
# note, error handling is done in the get function, so this will never be null, but # note, error handling is done in the get function, so this will never be null, but

View file

@ -1,3 +1,17 @@
=====================================================================================
Version: 2.1.11
Patch Version: 00
Script Date: 2014-03-26
-----------------------------------
Changes:
-----------------------------------
New version: fixed an old bug, with -c 0, no colors, RED and NORMAL color codes were
not set to null, which results in some cases with red output, along with turning
terminal/console font color red.
-----------------------------------
-- Harald Hope - Wed, 26 Mar 2014 12:44:53 -0700
===================================================================================== =====================================================================================
Version: 2.1.10 Version: 2.1.10
Patch Version: 00 Patch Version: 00