From db313ba89e9d6eecc6b605576931947d68a0e5dc Mon Sep 17 00:00:00 2001 From: Christophe Drevet Date: Fri, 4 Jan 2013 13:01:06 +0100 Subject: [PATCH] LP_PS1_PREFIX used to add arbitrary prompt before anything else --- README.md | 7 +++++++ liquidprompt | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cd19141..6f38323 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,13 @@ Note also that all the `LP_ENABLE_…` variables override the templates, i.e. if you use `$LP_BATT` in your template and you set `LP_ENABLE_BATT=0` in your config file, you will not have the battery informations. +## ADD A PS1 PREFIX + +You can prefix the `LP_PS1` variable with anything you want using the +`LP_PS1_PREFIX`. The following example activate title change on xterm-like +windows: + + export LP_PS1_PREFIX="\[\e]0;\u@\h: \w\a\]" ## PUT THE PROMPT IN A DIFFERENT ORDER diff --git a/liquidprompt b/liquidprompt index 4874551..02d643b 100755 --- a/liquidprompt +++ b/liquidprompt @@ -189,6 +189,7 @@ _lp_source_config() LP_PATH_KEEP=${LP_PATH_KEEP:-2} LP_HOSTNAME_ALWAYS=${LP_HOSTNAME_ALWAYS:-0} LP_PS1=${LP_PS1:-""} + LP_PS1_PREFIX=${LP_PS1_PREFIX:-""} LP_ENABLE_PERM=${LP_ENABLE_PERM:-1} LP_ENABLE_SHORTEN_PATH=${LP_ENABLE_SHORTEN_PATH:-1} @@ -1016,7 +1017,7 @@ _lp_set_prompt() if [[ -z $LP_PS1 ]] ; then # add time, jobs, load and battery - PS1="${LP_TIME}${LP_BATT}${LP_LOAD}${LP_JOBS}" + PS1="${LP_PS1_PREFIX}${LP_TIME}${LP_BATT}${LP_LOAD}${LP_JOBS}" # add user, host and permissions colon PS1="${PS1}[${LP_USER}${LP_HOST}${LP_PERM}"