mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
fixes and tweaks
This commit is contained in:
parent
cff962b5e7
commit
5b6a704401
28
inxi
28
inxi
|
@ -308,9 +308,9 @@ DEFAULT_COLOR_SCHEME=2
|
|||
# for user changes easier after sourcing the files
|
||||
GLOBAL_COLOR_SCHEME=''
|
||||
IRC_COLOR_SCHEME=''
|
||||
CONSOLE_IRC_COLOR_SCHEME=''
|
||||
IRC_TERM_COLOR_SCHEME=''
|
||||
CONSOLE_COLOR_SCHEME=''
|
||||
VIRT_TERMINAL_COLOR_SCHEME=''
|
||||
VIRT_TERM_COLOR_SCHEME=''
|
||||
|
||||
# Default indentation level
|
||||
INDENT=10
|
||||
|
@ -560,16 +560,16 @@ main()
|
|||
set_color_scheme $GLOBAL_COLOR_SCHEME
|
||||
elif [[ -n $CONSOLE_COLOR_SCHEME && -z $DISPLAY ]];then
|
||||
set_color_scheme $CONSOLE_COLOR_SCHEME
|
||||
elif [[ -n $VIRT_TERMINAL_COLOR_SCHEME ]];then
|
||||
set_color_scheme $VIRT_TERMINAL_COLOR_SCHEME
|
||||
elif [[ -n $VIRT_TERM_COLOR_SCHEME ]];then
|
||||
set_color_scheme $VIRT_TERM_COLOR_SCHEME
|
||||
else
|
||||
set_color_scheme "$DEFAULT_COLOR_SCHEME"
|
||||
fi
|
||||
else
|
||||
if [[ -n $GLOBAL_COLOR_SCHEME ]];then
|
||||
set_color_scheme $GLOBAL_COLOR_SCHEME
|
||||
elif [[ -n $CONSOLE_IRC_COLOR_SCHEME && -z $DISPLAY ]];then
|
||||
set_color_scheme $CONSOLE_IRC_COLOR_SCHEME
|
||||
elif [[ -n $IRC_TERM_COLOR_SCHEME && -z $DISPLAY ]];then
|
||||
set_color_scheme $IRC_TERM_COLOR_SCHEME
|
||||
elif [[ -n $IRC_COLOR_SCHEME ]];then
|
||||
set_color_scheme $IRC_COLOR_SCHEME
|
||||
else
|
||||
|
@ -872,13 +872,13 @@ select_default_color_scheme()
|
|||
config_variable='IRC_COLOR_SCHEME'
|
||||
;;
|
||||
irc-terminal)
|
||||
config_variable='CONSOLE_IRC_COLOR_SCHEME'
|
||||
config_variable='IRC_TERM_COLOR_SCHEME'
|
||||
;;
|
||||
terminal)
|
||||
config_variable='CONSOLE_COLOR_SCHEME'
|
||||
;;
|
||||
virtual-terminal)
|
||||
config_variable='VIRT_TERMINAL_COLOR_SCHEME'
|
||||
config_variable='VIRT_TERM_COLOR_SCHEME'
|
||||
;;
|
||||
global)
|
||||
config_variable='GLOBAL_COLOR_SCHEME'
|
||||
|
@ -902,19 +902,21 @@ select_default_color_scheme()
|
|||
sed -i '/GLOBAL_COLOR_SCHEME=/d' $config_file
|
||||
;;
|
||||
global)
|
||||
sed -i -e '/VIRT_TERMINAL_COLOR_SCHEME=/d' -e '/CONSOLE_COLOR_SCHEME=/d' -e '/IRC_COLOR_SCHEME=/d' \
|
||||
-e '/CONSOLE_IRC_COLOR_SCHEME=/d' $config_file
|
||||
sed -i -e '/VIRT_TERM_COLOR_SCHEME=/d' -e '/CONSOLE_COLOR_SCHEME=/d' -e '/IRC_COLOR_SCHEME=/d' \
|
||||
-e '/IRC_TERM_COLOR_SCHEME=/d' $config_file
|
||||
;;
|
||||
esac
|
||||
elif [[ $user_selection == $i ]];then
|
||||
print_screen_output "Removing all color settings from config file now..."
|
||||
sed -i -e '/VIRT_TERMINAL_COLOR_SCHEME=/d' -e '/GLOBAL_COLOR_SCHEME=/d' -e '/CONSOLE_COLOR_SCHEME=/d' \
|
||||
-e '/IRC_COLOR_SCHEME=/d' -e '/CONSOLE_IRC_COLOR_SCHEME=/d' $config_file
|
||||
sed -i -e '/VIRT_TERM_COLOR_SCHEME=/d' -e '/GLOBAL_COLOR_SCHEME=/d' -e '/CONSOLE_COLOR_SCHEME=/d' \
|
||||
-e '/IRC_COLOR_SCHEME=/d' -e '/IRC_TERM_COLOR_SCHEME=/d' $config_file
|
||||
set_color_scheme $DEFAULT_COLOR_SCHEME
|
||||
elif [[ $user_selection == $(( $i+1 )) ]];then
|
||||
print_screen_output "Ok, continuing $SCRIPT_NAME unchanged. You can set the colors anytime by starting with: -c 96 to 99"
|
||||
if [[ -n $CONSOLE_COLOR_SCHEME ]];then
|
||||
if [[ -n $CONSOLE_COLOR_SCHEME && -z $DISPLAY ]];then
|
||||
set_color_scheme $CONSOLE_COLOR_SCHEME
|
||||
elif [[ -n $VIRT_TERM_COLOR_SCHEME ]];then
|
||||
set_color_scheme $VIRT_TERM_COLOR_SCHEME
|
||||
else
|
||||
set_color_scheme $DEFAULT_COLOR_SCHEME
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue