Bug fix on color setting

This commit is contained in:
inxi-svn 2008-10-29 21:47:13 +00:00
parent 15912c0455
commit a253b4bf68

14
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 0.1.34
#### version: 0.1.35
#### Date: October 29 2008
########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -36,6 +36,8 @@
########################################################################
## Variable initializations: null values
COLOR_SCHEME_SET=''
CSCHEME=''
DISTRO=''
DISTRO_FILE=''
A_DISTRO_GLOB=''
@ -64,6 +66,7 @@ LSPCI=$( lspci -v | awk '{ gsub(/\(prog-if[^)]*\)/,""); print }' )
NO_CPU_COUNT=0 # Wether or not the string "dual" or similar is found in cpuinfo output. If so, avoid dups.
PARAMETER_LIMIT=30 # This is a variable that controls how many parameters infobash will parse in a /proc/<pid>/cmdline file before stopping.
RUNLVL=0 # just setting this to 0 to initialize and avoid test errors
SCHEME=0 # set default scheme
SHOW_HOST=1 # Set this to 0 to avoid printing the hostname
SHOW_IRC=2 # SHOW_IRC=1 to avoid showing the irc client version number, or SHOW_IRC=0 to disable client information completely.
VERBOSITY_LEVEL=0 # Verbosity level defaults to 0, this can also be set with -v, -v2, -v3, etc as a parameter.
@ -340,7 +343,7 @@ set_color_scheme()
C1="${!script_colors[0]}"
C2="${!script_colors[1]}"
CN="${!script_colors[2]}"
((CSCHEME++)) ## note: why is this? ##
# ((CSCHEME++)) ## note: why is this? ##
}
# Parse the null separated commandline under /proc/<pid passed in $1>/cmdline
@ -416,7 +419,8 @@ get_parameters()
[0-9]|[0-9][0-9])
# these will need to be converted to standard type options
echo "$1" | grep -q '^[0-9][0-9]\?$' || error_handler 3 "$1"
if ! ((CSCHEME))
COLOR_SCHEME_SET='true'
if [ -z "$CSCHEME" ]
then
set_color_scheme "$1"
fi
@ -484,7 +488,7 @@ get_start_source()
IRC_CLIENT="Shell"
unset IRC_CLIENT_VERSION
IBSHELL=1
elif [[ -n $PPID && -f /proc/$PPID/exe ]]
elif [ -n "$PPID" -a -f "/proc/$PPID/exe" ]
then
irc_client_path=$( readlink /proc/$PPID/exe )
# this handles the problem with konversation reporting itself as perl, which was missed because
@ -1390,7 +1394,7 @@ fi
get_parameters "$@"
# If no colorscheme was set in the parameter handling routine, then set the default scheme
if [ "$CSCHEME" -eq 0 ]
if [ "$COLOR_SCHEME_SET" != 'true' ]
then
set_color_scheme "$DEFAULT_SCHEME"
fi