mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
fine tuning
This commit is contained in:
parent
a98f9907fe
commit
7733536589
25
inxi
25
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.4.82-b3
|
#### version: 1.4.82-b4
|
||||||
#### Date: April 25 2011
|
#### Date: April 25 2011
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
|
@ -306,7 +306,7 @@ DEBUG_BUFFER_INDEX=0
|
||||||
DEFAULT_COLOR_SCHEME=2
|
DEFAULT_COLOR_SCHEME=2
|
||||||
# Always leave this blank, this is only going to be set in inxi.conf files, that makes testing
|
# Always leave this blank, this is only going to be set in inxi.conf files, that makes testing
|
||||||
# for user changes easier after sourcing the files
|
# for user changes easier after sourcing the files
|
||||||
DEFAULT_COLOR_SCHEME_OVERRIDE=''
|
DEFAULT_TERM_COLOR_SCHEME=''
|
||||||
|
|
||||||
# Default indentation level
|
# Default indentation level
|
||||||
INDENT=10
|
INDENT=10
|
||||||
|
@ -545,10 +545,14 @@ main()
|
||||||
# This will only trigger on first run out of irc cases, let's user pick their color scheme
|
# This will only trigger on first run out of irc cases, let's user pick their color scheme
|
||||||
# The override value only will occur in user config files
|
# The override value only will occur in user config files
|
||||||
if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
|
if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
|
||||||
if [[ -z $DEFAULT_COLOR_SCHEME_OVERRIDE || $B_RUN_COLOR_SELECTOR == 'true' ]];then
|
# note, leaving this iff as a first run default for now, too many possible glitches could happen
|
||||||
|
# if [[ -z $DEFAULT_TERM_COLOR_SCHEME || $B_RUN_COLOR_SELECTOR == 'true' ]];then
|
||||||
|
if [[ $B_RUN_COLOR_SELECTOR == 'true' ]];then
|
||||||
select_default_color_scheme
|
select_default_color_scheme
|
||||||
elif [[ -n $DEFAULT_COLOR_SCHEME_OVERRIDE ]];then
|
elif [[ -n $DEFAULT_TERM_COLOR_SCHEME ]];then
|
||||||
set_color_scheme $DEFAULT_COLOR_SCHEME_OVERRIDE
|
set_color_scheme $DEFAULT_TERM_COLOR_SCHEME
|
||||||
|
else
|
||||||
|
set_color_scheme "$DEFAULT_COLOR_SCHEME"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
set_color_scheme "$DEFAULT_COLOR_SCHEME"
|
set_color_scheme "$DEFAULT_COLOR_SCHEME"
|
||||||
|
@ -818,7 +822,8 @@ select_default_color_scheme()
|
||||||
print_screen_output "You will see this message only one time per user account, unless you set preferences in: /etc/$SCRIPT_NAME.conf"
|
print_screen_output "You will see this message only one time per user account, unless you set preferences in: /etc/$SCRIPT_NAME.conf"
|
||||||
print_screen_output ""
|
print_screen_output ""
|
||||||
print_screen_output "Because there is no way to know your terminal client's foreground/background colors, we need"
|
print_screen_output "Because there is no way to know your terminal client's foreground/background colors, we need"
|
||||||
print_screen_output "to set your color preferences from color scheme option list below. 0 is no colors."
|
print_screen_output "to set your color preferences from color scheme option list below. 0 is no colors, 1 neutral gray."
|
||||||
|
print_screen_output "After these, there are 3 sets: 1-dark or light backgrounds; 2-light backgrounds; 3-dark backgrounds."
|
||||||
print_screen_output "Please note that this will set the preferences only for your user account: $(whoami)"
|
print_screen_output "Please note that this will set the preferences only for your user account: $(whoami)"
|
||||||
print_screen_output "------------------------------------------------------------------------------"
|
print_screen_output "------------------------------------------------------------------------------"
|
||||||
for (( i=0; i < ${#A_COLOR_SCHEMES[@]}; i++ ))
|
for (( i=0; i < ${#A_COLOR_SCHEMES[@]}; i++ ))
|
||||||
|
@ -834,23 +839,23 @@ select_default_color_scheme()
|
||||||
print_screen_output "[0m $(($i+1)))$spacer${C1} Exit, use another terminal, or set manually."
|
print_screen_output "[0m $(($i+1)))$spacer${C1} Exit, use another terminal, or set manually."
|
||||||
print_screen_output "------------------------------------------------------------------------------"
|
print_screen_output "------------------------------------------------------------------------------"
|
||||||
print_screen_output "Simply type the number for the color scheme that looks best to your eyes in the terminal client"
|
print_screen_output "Simply type the number for the color scheme that looks best to your eyes in the terminal client"
|
||||||
print_screen_output "you are using and hit enter. NOTE: You can bring this option list up by starting $SCRIPT_NAME with this option: "
|
print_screen_output "you are using and hit enter. NOTE: You can bring this option list up by starting $SCRIPT_NAME with this option: -c 99"
|
||||||
print_screen_output "Your selection will be stored here: $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf"
|
print_screen_output "Your selection will be stored here: $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf"
|
||||||
print_screen_output "------------------------------------------------------------------------------"
|
print_screen_output "------------------------------------------------------------------------------"
|
||||||
echo -n "[0m"
|
echo -n "[0m"
|
||||||
read user_selection
|
read user_selection
|
||||||
if [[ -n $( grep -Es '^([0-9]+)$' <<< "$user_selection" ) && $user_selection -lt $i ]];then
|
if [[ -n $( grep -Es '^([0-9]+)$' <<< "$user_selection" ) && $user_selection -lt $i ]];then
|
||||||
set_color_scheme $user_selection
|
set_color_scheme $user_selection
|
||||||
if [[ ! -f $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf || -z $( grep -s 'DEFAULT_COLOR_SCHEME_OVERRIDE=' $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf ) ]];then
|
if [[ ! -f $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf || -z $( grep -s 'DEFAULT_TERM_COLOR_SCHEME=' $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf ) ]];then
|
||||||
if [[ ! -d $HOME/.$SCRIPT_NAME ]];then
|
if [[ ! -d $HOME/.$SCRIPT_NAME ]];then
|
||||||
mkdir $HOME/.$SCRIPT_NAME
|
mkdir $HOME/.$SCRIPT_NAME
|
||||||
fi
|
fi
|
||||||
touch $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf
|
touch $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf
|
||||||
print_screen_output "Creating and updating config file now..."
|
print_screen_output "Creating and updating config file now..."
|
||||||
echo "DEFAULT_COLOR_SCHEME_OVERRIDE=$user_selection" >> $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf
|
echo "DEFAULT_TERM_COLOR_SCHEME=$user_selection" >> $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf
|
||||||
else
|
else
|
||||||
print_screen_output "Updating config file now..."
|
print_screen_output "Updating config file now..."
|
||||||
sed -i "s/DEFAULT_COLOR_SCHEME_OVERRIDE=.*/DEFAULT_COLOR_SCHEME_OVERRIDE=$user_selection/" $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf
|
sed -i "s/DEFAULT_TERM_COLOR_SCHEME=.*/DEFAULT_TERM_COLOR_SCHEME=$user_selection/" $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf
|
||||||
fi
|
fi
|
||||||
elif [[ $user_selection == $i ]];then
|
elif [[ $user_selection == $i ]];then
|
||||||
set_color_scheme $DEFAULT_COLOR_SCHEME
|
set_color_scheme $DEFAULT_COLOR_SCHEME
|
||||||
|
|
Loading…
Reference in a new issue