diff --git a/README.md b/README.md index f4aabce..a3a4c34 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/liquidprompt.bash b/liquidprompt.bash index 96791f8..dceca40 100755 --- a/liquidprompt.bash +++ b/liquidprompt.bash @@ -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 diff --git a/liquidpromptrc-dist b/liquidpromptrc-dist index 08d4f14..d6d067d 100644 --- a/liquidpromptrc-dist +++ b/liquidpromptrc-dist @@ -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 +