From c44967f4dc72c1366891ea09a1bba2abda4c976b Mon Sep 17 00:00:00 2001 From: ap Date: Tue, 28 May 2024 20:57:15 -0400 Subject: [PATCH 1/3] add venv support for half-life theme --- themes/half-life/half-life.theme.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/themes/half-life/half-life.theme.sh b/themes/half-life/half-life.theme.sh index d9a741c8b..bb93dbd2d 100644 --- a/themes/half-life/half-life.theme.sh +++ b/themes/half-life/half-life.theme.sh @@ -16,7 +16,13 @@ function _omb_theme_PROMPT_COMMAND { local ps_path="${_omb_prompt_green}\w${_omb_prompt_normal}" local ps_user_mark="${_omb_prompt_red}λ${_omb_prompt_normal}" - PS1="$ps_username in $ps_path$(_omb_theme_half_way_prompt_scm) $ps_user_mark " + local python_venv + _omb_prompt_get_python_venv + + PS1="$ps_username in $python_venv $ps_path$(_omb_theme_half_way_prompt_scm) $ps_user_mark " } +OMB_PROMPT_SHOW_PYTHON_VENV=${OMB_PROMPT_SHOW_PYTHON_VENV:-false} +OMB_PROMPT_VIRTUALENV_FORMAT="${_omb_prompt_olive}(%s)${_omb_prompt_reset_color}" + _omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND From 64d87a15ac71a998f280f9b12a166d8a2a37abf8 Mon Sep 17 00:00:00 2001 From: ap Date: Wed, 29 May 2024 08:00:39 -0400 Subject: [PATCH 2/3] fix extra space when no venv --- themes/half-life/half-life.theme.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/themes/half-life/half-life.theme.sh b/themes/half-life/half-life.theme.sh index bb93dbd2d..6063ad21e 100644 --- a/themes/half-life/half-life.theme.sh +++ b/themes/half-life/half-life.theme.sh @@ -5,24 +5,24 @@ OSH_THEME_GIT_PROMPT_CLEAN="✓" # Nicely formatted terminal prompt function _omb_theme_half_way_prompt_scm { - local CHAR=$(scm_char) - if [[ $CHAR != "$SCM_NONE_CHAR" ]]; then - printf '%s' " on ${_omb_prompt_navy}$(git_current_branch)$(parse_git_dirty)${_omb_prompt_normal} " - fi + local CHAR=$(scm_char) + if [[ $CHAR != "$SCM_NONE_CHAR" ]]; then + printf '%s' " on ${_omb_prompt_navy}$(git_current_branch)$(parse_git_dirty)${_omb_prompt_normal} " + fi } function _omb_theme_PROMPT_COMMAND { - local ps_username="${_omb_prompt_purple}\u${_omb_prompt_normal}" - local ps_path="${_omb_prompt_green}\w${_omb_prompt_normal}" - local ps_user_mark="${_omb_prompt_red}λ${_omb_prompt_normal}" - - local python_venv - _omb_prompt_get_python_venv - - PS1="$ps_username in $python_venv $ps_path$(_omb_theme_half_way_prompt_scm) $ps_user_mark " + local ps_username="${_omb_prompt_purple}\u${_omb_prompt_normal}" + local ps_path="${_omb_prompt_green}\w${_omb_prompt_normal}" + local ps_user_mark="${_omb_prompt_red}λ${_omb_prompt_normal}" + + local python_venv + _omb_prompt_get_python_venv + + PS1="$ps_username in $python_venv$ps_path$(_omb_theme_half_way_prompt_scm) $ps_user_mark " } OMB_PROMPT_SHOW_PYTHON_VENV=${OMB_PROMPT_SHOW_PYTHON_VENV:-false} -OMB_PROMPT_VIRTUALENV_FORMAT="${_omb_prompt_olive}(%s)${_omb_prompt_reset_color}" +OMB_PROMPT_VIRTUALENV_FORMAT="${_omb_prompt_olive}(%s)${_omb_prompt_reset_color} " _omb_util_add_prompt_command _omb_theme_PROMPT_COMMAND From d61bc1700f13a8aa55a0eba3da07dd6fb5891ad2 Mon Sep 17 00:00:00 2001 From: ap Date: Wed, 29 May 2024 08:02:34 -0400 Subject: [PATCH 3/3] revert spacing --- themes/half-life/half-life.theme.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/themes/half-life/half-life.theme.sh b/themes/half-life/half-life.theme.sh index 6063ad21e..3db590b78 100644 --- a/themes/half-life/half-life.theme.sh +++ b/themes/half-life/half-life.theme.sh @@ -5,21 +5,21 @@ OSH_THEME_GIT_PROMPT_CLEAN="✓" # Nicely formatted terminal prompt function _omb_theme_half_way_prompt_scm { - local CHAR=$(scm_char) - if [[ $CHAR != "$SCM_NONE_CHAR" ]]; then - printf '%s' " on ${_omb_prompt_navy}$(git_current_branch)$(parse_git_dirty)${_omb_prompt_normal} " - fi + local CHAR=$(scm_char) + if [[ $CHAR != "$SCM_NONE_CHAR" ]]; then + printf '%s' " on ${_omb_prompt_navy}$(git_current_branch)$(parse_git_dirty)${_omb_prompt_normal} " + fi } function _omb_theme_PROMPT_COMMAND { - local ps_username="${_omb_prompt_purple}\u${_omb_prompt_normal}" - local ps_path="${_omb_prompt_green}\w${_omb_prompt_normal}" - local ps_user_mark="${_omb_prompt_red}λ${_omb_prompt_normal}" - - local python_venv - _omb_prompt_get_python_venv - - PS1="$ps_username in $python_venv$ps_path$(_omb_theme_half_way_prompt_scm) $ps_user_mark " + local ps_username="${_omb_prompt_purple}\u${_omb_prompt_normal}" + local ps_path="${_omb_prompt_green}\w${_omb_prompt_normal}" + local ps_user_mark="${_omb_prompt_red}λ${_omb_prompt_normal}" + + local python_venv + _omb_prompt_get_python_venv + + PS1="$ps_username in $python_venv$ps_path$(_omb_theme_half_way_prompt_scm) $ps_user_mark " } OMB_PROMPT_SHOW_PYTHON_VENV=${OMB_PROMPT_SHOW_PYTHON_VENV:-false}