@@ -9,7 +9,12 @@ __bash_it_theme_liquidprompt_path="github.com/nojhan/liquidprompt"
9
9
__bash_it_theme_liquidprompt_dir=" ${BASH_IT?} /vendor/${__bash_it_theme_liquidprompt_path} "
10
10
if [[ ! -d " ${__bash_it_theme_liquidprompt_dir} " ]]; then
11
11
if git clone --branch stable " https://${__bash_it_theme_liquidprompt_path} " " ${__bash_it_theme_liquidprompt_dir} " ; then
12
- echo -e " Successfully cloned liquidprompt!\n More configuration in '${__bash_it_theme_liquidprompt_dir/ $HOME / \~ } /liquid.theme'."
12
+ __bash_it_theme_liquidprompt_lqprc=" ${XDG_CONFIG_HOME:- " $HOME /.config" } /liquidpromptrc"
13
+ __bash_it_theme_liquidprompt_tilde=' ~'
14
+ if [[ ! -e " ${__bash_it_theme_liquidprompt_lqprc} " ]]; then
15
+ sed -e ' s/^LP_/#LP_/g' -e ' s;#LOCAL_RCFILE=$HOME/.liquidpromptrc.local;LOCAL_RCFILE=${BASH_SOURCE[0]}.local;g' -e ' s/#\[ -f "$LOCAL_RCFILE" \] && source "$LOCAL_RCFILE"/if [[ -s $LOCAL_RCFILE ]]; then\' $' \n\t ' ' source "$LOCAL_RCFILE"\' $' \n ' ' fi/g' < " ${__bash_it_theme_liquidprompt_dir} /liquidpromptrc-dist" > " ${__bash_it_theme_liquidprompt_lqprc} "
16
+ fi
17
+ echo -e " Successfully cloned liquidprompt!\n More configuration in '${__bash_it_theme_liquidprompt_lqprc// $HOME / $__bash_it_theme_liquidprompt_tilde } ' (or '${__bash_it_theme_liquidprompt_lqprc// $HOME / $__bash_it_theme_liquidprompt_tilde } .local')."
13
18
fi
14
19
fi
15
20
@@ -22,9 +27,19 @@ LP_MARK_LOAD="📈 "
22
27
: " ${LP_LOAD_THRESHOLD:= 60} "
23
28
: " ${LP_TEMP_THRESHOLD:= 80} "
24
29
25
- # # Load theme
30
+ # # Load theme, but don't activate
26
31
# shellcheck source-path=SCRIPTDIR/../../vendor/github.com/nojhan/liquidprompt
27
- source " ${__bash_it_theme_liquidprompt_dir} /liquidprompt"
32
+ source " ${__bash_it_theme_liquidprompt_dir} /liquidprompt" --no-activate
33
+
34
+ # # Activate theme, without clobbering `bash-preexec`
35
+ LP_OLD_PS1=" ${PROMPT:- ${PS1:- \$ } } "
36
+ LP_OLD_PROMPT_COMMAND=" "
37
+ function prompt_on() { : ; }
38
+ function prompt_off() { : ; }
39
+ function prompt_OFF() { : ; }
40
+ TERM_PROGRAM=not_apple_terminal LP_ENABLE_RUNTIME=0 LP_ENABLE_RUNTIME_BELL=0 lp_activate
41
+ safe_append_preexec ' __lp_runtime_before'
42
+ safe_append_prompt_command ' __lp_set_prompt'
28
43
29
44
# # Override upstream defaults
30
45
PS2=" ┃ "
@@ -74,3 +89,5 @@ function _lp_temp_acpi() {
74
89
(( i > ${temperature:- 0} )) && (( i != 127 )) && temperature=i
75
90
done
76
91
}
92
+
93
+ unset " ${! __bash_it_theme_liquidprompt_@ } "
0 commit comments