diff --git a/README.md b/README.md index 1538681..ee97816 100644 --- a/README.md +++ b/README.md @@ -329,6 +329,18 @@ All these values should be set using a the correct colour code for your terminal. You should also choose the colour code based on what shell you are using. There is a way to support [colouring multiple shells using rc files](#setting-an-rc-file). +##### Colouring the Wrapper part +**GIT_RADAR_COLOR_GIT_WRAPPER='[colour code]'** +``` +git:(my-branch) +^^^^^ ^ +``` +The colour to use for the wrapper surrounding git status information + +It is unset by +`GIT_RADAR_COLOR_WRAPPER_RESET` which you can set if you want a different +background colour to return to. + ##### Colouring the Branch part **GIT_RADAR_COLOR_BRANCH='[colour code]'** diff --git a/prompt.bash b/prompt.bash index 51c4db7..c8d2f72 100755 --- a/prompt.bash +++ b/prompt.bash @@ -6,12 +6,12 @@ source "$dot/radar-base.sh" if is_repo; then prepare_bash_colors - printf " \x01\033[1;30m\x02git:(\x01\033[0m\x02" + printf "${COLOR_GIT_WRAPPER}git:(${RESET_COLOR_WRAPPER}" if show_remote_status $args; then color_remote_commits fi readable_branch_name color_local_commits - printf "\x01\033[1;30m\x02)\x01\033[0m\x02" + printf "${COLOR_GIT_WRAPPER})${RESET_COLOR_WRAPPER}" color_changes_status fi diff --git a/prompt.zsh b/prompt.zsh index 2d31820..ff7dc7c 100755 --- a/prompt.zsh +++ b/prompt.zsh @@ -8,12 +8,12 @@ if is_repo; then autoload colors && colors prepare_zsh_colors - printf '%s' "%{$fg_bold[black]%} git:(%{$reset_color%}" + printf '%s' "${COLOR_GIT_WRAPPER}git:(${RESET_COLOR_WRAPPER}" if show_remote_status $args; then color_remote_commits fi readable_branch_name color_local_commits - printf '%s' "%{$fg_bold[black]%})%{$reset_color%}" + printf '%s' "${COLOR_GIT_WRAPPER})${RESET_COLOR_WRAPPER}" color_changes_status fi diff --git a/radar-base.sh b/radar-base.sh index d9cd8f5..3629db7 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -14,6 +14,8 @@ prepare_bash_colors() { PRINT_F_OPTION="" + COLOR_GIT_WRAPPER="\x01${GIT_RADAR_GIT_WRAPPER:-"\\033[1;30m"}\x02" + COLOR_REMOTE_AHEAD="\x01${GIT_RADAR_COLOR_REMOTE_AHEAD:-"\\033[1;32m"}\x02" COLOR_REMOTE_BEHIND="\x01${GIT_RADAR_COLOR_REMOTE_BEHIND:-"\\033[1;31m"}\x02" COLOR_REMOTE_DIVERGED="\x01${GIT_RADAR_COLOR_REMOTE_DIVERGED:-"\\033[1;33m"}\x02" @@ -31,6 +33,7 @@ prepare_bash_colors() { COLOR_BRANCH="\x01${GIT_RADAR_COLOR_BRANCH:-"\\033[0m"}\x02" MASTER_SYMBOL="${GIT_RADAR_MASTER_SYMBOL:-"\\x01\\033[0m\\x02\\xF0\\x9D\\x98\\xAE\\x01\\033[0m\\x02"}" + RESET_COLOR_WRAPPER="\x01${GIT_RADAR_COLOR_WRAPPER_RESET:-"\\033[0m"}\x02" RESET_COLOR_LOCAL="\x01${GIT_RADAR_COLOR_LOCAL_RESET:-"\\033[0m"}\x02" RESET_COLOR_REMOTE="\x01${GIT_RADAR_COLOR_REMOTE_RESET:-"\\033[0m"}\x02" RESET_COLOR_CHANGES="\x01${GIT_RADAR_COLOR_CHANGES_RESET:-"\\033[0m"}\x02" @@ -46,6 +49,8 @@ prepare_zsh_colors() { PRINT_F_OPTION="%s" + COLOR_GIT_WRAPPER="%{${GIT_RADAR_COLOR_GIT_WRAPPER:-$fg_bold[black]}%}" + COLOR_REMOTE_AHEAD="%{${GIT_RADAR_COLOR_REMOTE_AHEAD:-$fg_bold[green]}%}" COLOR_REMOTE_BEHIND="%{${GIT_RADAR_COLOR_REMOTE_BEHIND:-$fg_bold[red]}%}" COLOR_REMOTE_DIVERGED="%{${GIT_RADAR_COLOR_REMOTE_DIVERGED:-$fg_bold[yellow]}%}" @@ -65,6 +70,7 @@ prepare_zsh_colors() { COLOR_BRANCH="%{${GIT_RADAR_COLOR_BRANCH:-$reset_color}%}" MASTER_SYMBOL="${GIT_RADAR_MASTER_SYMBOL:-"%{$reset_color%}$italic_m%{$reset_color%}"}" + RESET_COLOR_WRAPPER="%{${GIT_RADAR_COLOR_WRAPPER_RESET:-$reset_color}%}" RESET_COLOR_LOCAL="%{${GIT_RADAR_COLOR_LOCAL_RESET:-$reset_color}%}" RESET_COLOR_REMOTE="%{${GIT_RADAR_COLOR_REMOTE_RESET:-$reset_color}%}" RESET_COLOR_CHANGES="%{${GIT_RADAR_COLOR_CHANGES_RESET:-$reset_color}%}"