Fixed wrong color handling and FQDN if no domainname is configured.

This commit is contained in:
ec2-user 2021-04-30 15:00:19 +02:00
parent 621143bea2
commit fcda37b123

View File

@ -2,7 +2,11 @@
# System Name and type detectedn # System Name and type detectedn
# #
mySystem=$(uname -n) mySystem=$(uname -n)
myFQDN="$(uname -n).$(dnsdomainname)" if dnsdomainname &> /dev/null ; then
myFQDN=$(uname -n).$(dnsdomainname)
else
myFQDN=$(uname -n)
fi
myCategory="{{.bash.prompt.category}}" myCategory="{{.bash.prompt.category}}"
myColor="{{.bash.prompt.color}}" myColor="{{.bash.prompt.color}}"
myType="{{.chezmoi.hostname}}" myType="{{.chezmoi.hostname}}"
@ -119,7 +123,7 @@ fast_git_ps1 ()
# magenta COLOR_MAGENTA 5 max,0,max # magenta COLOR_MAGENTA 5 max,0,max
# cyan COLOR_CYAN 6 0,max,max # cyan COLOR_CYAN 6 0,max,max
# white COLOR_WHITE 7 max,max,max # white COLOR_WHITE 7 max,max,max
setPrompt "${myCategory}" "${myPrettyName}" "${myColor:-5}" # setPrompt "${myCategory}" "${myPrettyName}" "${myColor:-5}"
if [[ -z "${myType// }" ]]; then if [[ -z "${myType// }" ]]; then
TYPE=$(uname -n) TYPE=$(uname -n)
@ -127,7 +131,7 @@ else
TYPE=" $myType " TYPE=" $myType "
fi fi
setPrompt "${myCategory}" "${myPrettyName}" ${1:-6} setPrompt "${myCategory}" "${myPrettyName}" ${myColor:-6}
# color_my_prompt # color_my_prompt
# TODO: background colors... # TODO: background colors...