Add Hostindicator to prompt

This commit is contained in:
TKE
2022-11-14 15:12:45 +01:00
parent 6ee3e22b46
commit c25555f367

View File

@@ -60,8 +60,14 @@ bash_prompt() {
local BAR_OFF="\[\033[1;0m\]" local BAR_OFF="\[\033[1;0m\]"
local UC=$W # user's color local UC=$W # user's color
[ $UID -eq "0" ] && UC=$R # root's color [ $UID -eq "0" ] && UC=$R # root's color
HOST_ICO=" "
hosthash=$(hostname | md5sum | cut -c1)
[[ $hosthash == "a" ]] && HOST_ICO=" "
[[ $hosthash == "9" ]] && HOST_ICO=" "
[[ $hosthash == "5" ]] && HOST_ICO="⭘ "
PS1="${TITLEBAR}${BAR_ON}\${NEW_BAR}${BAR_OFF}\r\n\t ${EMY}\${NEW_PWD}${EMK}]${UC}\n\\$ ${NONE}" PS1="${TITLEBAR}${BAR_ON}\${NEW_BAR}${BAR_OFF}\r\n\t\${HOST_ICO}${EMY}\${NEW_PWD}${EMK}]${UC}\n\\$ ${NONE}"
#PS1="${TITLEBAR}${BAR_ON}$(printf '_%.0s' $(seq 1 $(tput cols)))${BAR_OFF}\r\n ${NEW_PWD} :\n\$ " #PS1="${TITLEBAR}${BAR_ON}$(printf '_%.0s' $(seq 1 $(tput cols)))${BAR_OFF}\r\n ${NEW_PWD} :\n\$ "
#PS1='\[\033]0;\u - \w\007\]\[\033[44;37m\]'$(printf '_%.0s' $(seq 1 $(tput cols)))'\[\033[1;0m\]\r\n\t \w :\n\$ ' #PS1='\[\033]0;\u - \w\007\]\[\033[44;37m\]'$(printf '_%.0s' $(seq 1 $(tput cols)))'\[\033[1;0m\]\r\n\t \w :\n\$ '
# without colors: PS1="[\u@\h \${NEW_PWD}]\\$ " # without colors: PS1="[\u@\h \${NEW_PWD}]\\$ "