From ba683626a7787cffd1afde6d6b8b8b6f94ab7c9b Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 16 Nov 2014 11:42:22 -0500 Subject: [PATCH] Oh My Git! support --- README.md | 1 + liquidprompt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index fd54b75..3603e95 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,7 @@ building: * `LP_ENABLE_SSH_COLORS`, if you want different colors for hosts you SSH in * `LP_ENABLE_RUNTIME`, if you want to display the runtime of the last command * `LP_ENABLE_TIME`, if you want to display the time at which the prompt was shown +* `LP_ENABLE_OHMYGIT`, if you want to enable [Oh My Git](https://github.com/arialdomartini/oh-my-git) * `LP_TIME_ANALOG`, when showing time, use an analog clock instead of numeric values Note that if required commands are not installed, enabling the diff --git a/liquidprompt b/liquidprompt index cb22d22..3de57b0 100755 --- a/liquidprompt +++ b/liquidprompt @@ -290,6 +290,7 @@ _lp_source_config() LP_ENABLE_LOAD=${LP_ENABLE_LOAD:-1} LP_ENABLE_BATT=${LP_ENABLE_BATT:-1} LP_ENABLE_GIT=${LP_ENABLE_GIT:-1} + LP_ENABLE_OHMYGIT=${LP_ENABLE_OHMYGIT:-0} LP_ENABLE_SVN=${LP_ENABLE_SVN:-1} LP_ENABLE_VCSH=${LP_ENABLE_VCSH:-1} LP_ENABLE_FOSSIL=${LP_ENABLE_FOSSIL:-1} @@ -1695,8 +1696,10 @@ _lp_set_prompt() # Insert it in the prompt PS1="${LP_TITLE}${PS1}" + [[ $LP_ENABLE_OHMYGIT = 1 ]] && PS1="$(build_prompt)$PS1" else PS1=$LP_PS1 + [[ $LP_ENABLE_OHMYGIT = 1 ]] && PS1="$(build_prompt)$PS1" fi if [[ -z "$LP_RPS1" ]] ; then RPS1="${LP_TIME}${LP_LOAD}${LP_TEMP}${LP_BATT}" @@ -1727,6 +1730,7 @@ _lp_set_prompt() # Insert it in the prompt PS1="${LP_TITLE}${PS1}" + [[ $LP_ENABLE_OHMYGIT = 1 ]] && PS1="$(build_prompt)$PS1" # Glue the bash prompt always go to the first column. # Avoid glitches after interrupting a command with Ctrl-C @@ -1734,6 +1738,7 @@ _lp_set_prompt() #PS1="\[\033[G\]${PS1}${NO_COL}" else PS1=$LP_PS1 + [[ $LP_ENABLE_OHMYGIT = 1 ]] && PS1="$(build_prompt)$PS1" fi fi }