ip address can be enabled/disabled (default is enabled)
parent
758c57621a
commit
86aa9ff36a
|
|
@ -75,6 +75,9 @@ MAX_GIT_HEX_LENGTH=5
|
|||
# IP address
|
||||
IP_SEPARATOR=', '
|
||||
|
||||
# Show IP
|
||||
IP_ENABLED=1
|
||||
|
||||
# FUNCS =======================================================================
|
||||
|
||||
function ip {
|
||||
|
|
@ -82,6 +85,13 @@ function ip {
|
|||
echo -e "$(ips | sed -e :a -e '$!N;s/\n/${IP_SEPARATOR}/;ta' | sed -e 's/127\.0\.0\.1\${IP_SEPARATOR}//g'), ${myip}"
|
||||
}
|
||||
|
||||
# Displays ip prompt
|
||||
function ip_prompt_info() {
|
||||
if [[ $IP_ENABLED == 1 ]]; then
|
||||
echo -e " ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR})"
|
||||
fi
|
||||
}
|
||||
|
||||
# Displays virtual info prompt (virtualenv/rvm)
|
||||
function virtual_prompt_info() {
|
||||
local virtual_env_info=$(virtualenv_prompt)
|
||||
|
|
@ -176,9 +186,9 @@ function prompt() {
|
|||
[ $UID -eq "0" ] && UC=$SUPERUSER_COLOR
|
||||
|
||||
if [[ $VIRTUAL_PROMPT_ENABLED == 1 ]]; then
|
||||
PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR}) in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info)${reset_color} \$ "
|
||||
PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(virtual_prompt_info)$(scm_prompt_info)${reset_color} \$ "
|
||||
else
|
||||
PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h ${DEFAULT_COLOR}(${IP_COLOR}$(ip)${DEFAULT_COLOR}) in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info)${reset_color} \$ "
|
||||
PS1="$(scm_char) ${UC}\u ${DEFAULT_COLOR}at ${MACHINE_COLOR}\h$(ip_prompt_info) ${DEFAULT_COLOR}in ${DIRECTORY_COLOR}$(limited_pwd)${DEFAULT_COLOR}$(scm_prompt_info)${reset_color} \$ "
|
||||
fi
|
||||
PS2='> '
|
||||
PS4='+ '
|
||||
|
|
|
|||
Loading…
Reference in New Issue