mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
23 lines
674 B
Bash
23 lines
674 B
Bash
#! bash oh-my-bash.module
|
|
|
|
OSH_THEME_GIT_PROMPT_DIRTY="✗"
|
|
OSH_THEME_GIT_PROMPT_CLEAN="✓"
|
|
|
|
# Nicely formatted terminal prompt
|
|
_omb_theme_half_way_prompt_scm() {
|
|
local CHAR=$(scm_char)
|
|
if [[ $CHAR != "$SCM_NONE_CHAR" ]]; then
|
|
printf '%s' " on ${blue}$(git_current_branch)$(parse_git_dirty)${_omb_prompt_normal} "
|
|
fi
|
|
}
|
|
|
|
_omb_theme_PROMPT_COMMAND() {
|
|
local ps_username="${purple}\u${_omb_prompt_normal}"
|
|
local ps_path="${green}\w${_omb_prompt_normal}"
|
|
local ps_user_mark="${_omb_prompt_orange}λ${_omb_prompt_normal}"
|
|
|
|
PS1="$ps_username in $ps_path$(_omb_theme_half_way_prompt_scm) $ps_user_mark "
|
|
}
|
|
|
|
_omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND
|