config option to always display the hostname

Do you want to display the hostname, even if not connected through network?
Use LP_HOSTNAME_ALWAYS. It defaults to 0 (do not display hostname when localy
connected). Set it to 1 if you want to always see the hostname.
This commit is contained in:
nojhan 2012-08-07 20:52:32 +02:00
parent 6358ca90d3
commit 2c73402a31
3 changed files with 14 additions and 3 deletions

View File

@ -80,8 +80,10 @@ displayed
the path
* `LP_PATH_KEEP`, how many directories to keep at the beginning of a shortened
path
* `LP_REVERSE`, choose between reverse colors (black on white) instead of normal
theme (white on black)
* `LP_REVERSE`, choose between reverse colors (black on white) or normal theme
(white on black)
* `LP_HOSTNAME_ALWAYS`, choose between always displaying the hostname or showing
it only when connected with a remote shell
Most of the display is prepared in the `__set_bash_prompt` function, apart from
features that needs several colors (such as the load colormap). You can sort

View File

@ -278,7 +278,11 @@ __host_color()
ret="${NO_COL}"
if [[ "$conn" == "lcl" ]] ; then
ret="${ret}" # no hostname if local
if [[ $LP_HOSTNAME_ALWAYS == 0 ]] ; then
ret="${ret}" # no hostname if local
else
ret="${ret}@\h"
fi
elif [[ "$conn" == "ssh" ]] ; then
ret="${ret}@${BOLD_CYAN}\h"
elif [[ "$conn" == "tel" ]] ; then

View File

@ -24,3 +24,8 @@ LP_PATH_KEEP=2
# set to 1 if you use black on white
LP_REVERSE=0
# Do you want to display the hostname, even if not connected through network?
# Defaults to 0 (do not display hostname when localy connected)
# set to 1 if you want to always see the hostname
LP_HOSTNAME_ALWAYS=0