2022-01-15 19:00:35 +09:00
|
|
|
#! bash oh-my-bash.module
|
2021-11-10 22:48:48 +01:00
|
|
|
|
|
|
|
OSH_THEME_GIT_PROMPT_DIRTY="✗"
|
|
|
|
OSH_THEME_GIT_PROMPT_CLEAN="✓"
|
|
|
|
|
|
|
|
# Nicely formatted terminal prompt
|
2021-12-30 22:01:14 +09:00
|
|
|
_omb_theme_half_way_prompt_scm() {
|
2021-12-30 12:05:37 +01:00
|
|
|
local CHAR=$(scm_char)
|
2021-12-30 22:01:14 +09:00
|
|
|
if [[ $CHAR != "$SCM_NONE_CHAR" ]]; then
|
|
|
|
printf '%s' " on ${blue}$(git_current_branch)$(parse_git_dirty)${normal} "
|
2021-11-10 22:48:48 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-12-30 12:05:37 +01:00
|
|
|
prompt_command() {
|
|
|
|
local ps_username="${purple}\u${normal}"
|
|
|
|
local ps_path="${green}\w${normal}"
|
|
|
|
local ps_user_mark="${orange}λ${normal}"
|
2021-11-10 22:48:48 +01:00
|
|
|
|
2021-12-30 22:01:14 +09:00
|
|
|
PS1="$ps_username in $ps_path$(_omb_theme_half_way_prompt_scm) $ps_user_mark "
|
2021-11-10 22:48:48 +01:00
|
|
|
}
|
|
|
|
|
2021-12-30 22:01:14 +09:00
|
|
|
_omb_util_add_prompt_command prompt_command
|