refactor themes to support standardized clock functions

This commit is contained in:
MunifTanjim
2016-10-18 20:25:51 +06:00
parent 8dde691671
commit a2a6fa2812
20 changed files with 110 additions and 66 deletions

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
SCM_THEME_PROMPT_DIRTY=" ${red}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}"
SCM_THEME_PROMPT_PREFIX="(${yellow}"
@@ -13,7 +14,7 @@ RVM_THEME_PROMPT_PREFIX=""
RVM_THEME_PROMPT_SUFFIX=""
function prompt_command() {
dtime="${yellow}\T${normal}"
dtime="$(clock_prompt)"
user_host="${green}\u@${cyan}\h${normal}"
current_dir="${bold_blue}\w${normal}"
rvm_ruby="${bold_red}$(ruby_version_prompt)${normal}"
@@ -22,8 +23,11 @@ function prompt_command() {
arrow="${bold_white}${normal} "
prompt="${bold_green}\$${normal} "
PS1="${dtime} ${user_host}:${current_dir} ${rvm_ruby} ${git_branch}
PS1="${dtime}${user_host}:${current_dir} ${rvm_ruby} ${git_branch}
$arrow $prompt"
}
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$yellow"}
THEME_CLOCK_FORMAT=${THEME_TIME_FORMAT:-"%I:%M:%S "}
safe_append_prompt_command prompt_command