From 7b95c937668334e07dc652a633033e246fce12d6 Mon Sep 17 00:00:00 2001 From: Martin Gondermann Date: Sat, 4 Oct 2014 21:21:47 +0200 Subject: [PATCH] Added themes without display of exit state for Solarized theme, added tweaked themes for Ubuntu terminal fonts (see #77) --- themes/Default.bgptheme | 2 +- ....bgptheme => Default_NoExitState.bgptheme} | 3 +- themes/Default_NoExitState_Ubuntu.bgptheme | 52 +++++++++++++++++++ themes/Default_Ubuntu.bgptheme | 51 ++++++++++++++++++ themes/Solarized.bgptheme | 5 +- themes/Solarized_NoExitState.bgptheme | 51 ++++++++++++++++++ themes/Solarized_NoExitState_Ubuntu.bgptheme | 52 +++++++++++++++++++ themes/Solarized_Ubuntu.bgptheme | 51 ++++++++++++++++++ 8 files changed, 263 insertions(+), 4 deletions(-) rename themes/{NoLastCommandIndicator.bgptheme => Default_NoExitState.bgptheme} (96%) create mode 100644 themes/Default_NoExitState_Ubuntu.bgptheme create mode 100644 themes/Default_Ubuntu.bgptheme create mode 100644 themes/Solarized_NoExitState.bgptheme create mode 100644 themes/Solarized_NoExitState_Ubuntu.bgptheme create mode 100644 themes/Solarized_Ubuntu.bgptheme diff --git a/themes/Default.bgptheme b/themes/Default.bgptheme index 685ab1c..fbb56ab 100644 --- a/themes/Default.bgptheme +++ b/themes/Default.bgptheme @@ -26,7 +26,7 @@ define_git_prompt_colors() { # GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0 GIT_PROMPT_COMMAND_OK="${Green}✔" # indicator if the last command returned with an exit code of 0 - GIT_PROMPT_COMMAND_FAIL="${Red}✘" # indicator if the last command returned with an exit code of other than 0 + GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_" # indicator if the last command returned with an exit code of other than 0 # template for displaying the current virtual environment # use the placeholder _VIRTUALENV_ will be replaced with diff --git a/themes/NoLastCommandIndicator.bgptheme b/themes/Default_NoExitState.bgptheme similarity index 96% rename from themes/NoLastCommandIndicator.bgptheme rename to themes/Default_NoExitState.bgptheme index 751b7ed..e238749 100644 --- a/themes/NoLastCommandIndicator.bgptheme +++ b/themes/Default_NoExitState.bgptheme @@ -1,4 +1,5 @@ -# This is the default theme for gitprompt.sh without the indicator of the last command state +# This is the default theme for gitprompt.sh +# without the indicator of the last command state define_git_prompt_colors() { Time12a="\$(date +%H:%M)" diff --git a/themes/Default_NoExitState_Ubuntu.bgptheme b/themes/Default_NoExitState_Ubuntu.bgptheme new file mode 100644 index 0000000..1f7a1e7 --- /dev/null +++ b/themes/Default_NoExitState_Ubuntu.bgptheme @@ -0,0 +1,52 @@ +# This is the default theme for gitprompt.sh +# without the indicator of the last command state +# tweaked for Ubuntu terminal fonts + +define_git_prompt_colors() { + Time12a="\$(date +%H:%M)" + PathShort="\w" + + # These are the color definitions used by gitprompt.sh + GIT_PROMPT_PREFIX="[" # start of the git info string + GIT_PROMPT_SUFFIX="]" # the end of the git info string + GIT_PROMPT_SEPARATOR="|" # separates each item + + GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory + GIT_PROMPT_STAGED="${Red}● " # the number of staged files/directories + GIT_PROMPT_CONFLICTS="${Red}✖ " # the number of files in conflict + GIT_PROMPT_CHANGED="${Blue}✚ " # the number of changed files + + GIT_PROMPT_REMOTE=" " # the remote branch name (if any) and the symbols for ahead and behind + GIT_PROMPT_UNTRACKED="${Cyan}… " # the number of untracked files/dirs + GIT_PROMPT_STASHED="${BoldBlue}⚑ " # the number of stashed files/dir + GIT_PROMPT_CLEAN="${BoldGreen}✔ " # a colored flag indicating a "clean" repo + + # For the command indicator, the placeholder _LAST_COMMAND_STATE_ + # will be replaced with the exit code of the last command + # e.g. + # GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0 + # GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0 + + GIT_PROMPT_COMMAND_OK="${Green}✔ " # indicator if the last command returned with an exit code of 0 + GIT_PROMPT_COMMAND_FAIL="${Red}✘ " # indicator if the last command returned with an exit code of other than 0 + + # template for displaying the current virtual environment + # use the placeholder _VIRTUALENV_ will be replaced with + # the name of the current virtual environment (currently CONDA and VIRTUAL_ENV) + GIT_PROMPT_VIRTUALENV="(${Blue}_VIRTUALENV_${ResetColor}) " + + # _LAST_COMMAND_INDICATOR_ will be replaced by the appropriate GIT_PROMPT_COMMAND_OK OR GIT_PROMPT_COMMAND_FAIL + GIT_PROMPT_START_USER="${Yellow}${PathShort}${ResetColor}" + GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}" + GIT_PROMPT_END_USER=" \n${White}${Time12a}${ResetColor} $ " + GIT_PROMPT_END_ROOT=" \n${White}${Time12a}${ResetColor} # " + + # Please do not add colors to these symbols + GIT_PROMPT_SYMBOLS_AHEAD="↑·" # The symbol for "n versions ahead of origin" + GIT_PROMPT_SYMBOLS_BEHIND="↓·" # The symbol for "n versions behind of origin" + GIT_PROMPT_SYMBOLS_PREHASH=":" # Written before hash of commit, if no name could be found +} + +if [[ -z "$GIT_PROMPT_SEPARATOR" || -z "$GIT_PROMPT_COMMAND_OK" ]]; then + define_git_prompt_colors +fi diff --git a/themes/Default_Ubuntu.bgptheme b/themes/Default_Ubuntu.bgptheme new file mode 100644 index 0000000..a1b54b0 --- /dev/null +++ b/themes/Default_Ubuntu.bgptheme @@ -0,0 +1,51 @@ +# This is the default theme for gitprompt.sh +# tweaked for Ubuntu terminal fonts + +define_git_prompt_colors() { + Time12a="\$(date +%H:%M)" + PathShort="\w" + + # These are the color definitions used by gitprompt.sh + GIT_PROMPT_PREFIX="[" # start of the git info string + GIT_PROMPT_SUFFIX="]" # the end of the git info string + GIT_PROMPT_SEPARATOR="|" # separates each item + + GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory + GIT_PROMPT_STAGED="${Red}● " # the number of staged files/directories + GIT_PROMPT_CONFLICTS="${Red}✖ " # the number of files in conflict + GIT_PROMPT_CHANGED="${Blue}✚ " # the number of changed files + + GIT_PROMPT_REMOTE=" " # the remote branch name (if any) and the symbols for ahead and behind + GIT_PROMPT_UNTRACKED="${Cyan}… " # the number of untracked files/dirs + GIT_PROMPT_STASHED="${BoldBlue}⚑ " # the number of stashed files/dir + GIT_PROMPT_CLEAN="${BoldGreen}✔ " # a colored flag indicating a "clean" repo + + # For the command indicator, the placeholder _LAST_COMMAND_STATE_ + # will be replaced with the exit code of the last command + # e.g. + # GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0 + # GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0 + + GIT_PROMPT_COMMAND_OK="${Green}✔ " # indicator if the last command returned with an exit code of 0 + GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_" # indicator if the last command returned with an exit code of other than 0 + + # template for displaying the current virtual environment + # use the placeholder _VIRTUALENV_ will be replaced with + # the name of the current virtual environment (currently CONDA and VIRTUAL_ENV) + GIT_PROMPT_VIRTUALENV="(${Blue}_VIRTUALENV_${ResetColor}) " + + # _LAST_COMMAND_INDICATOR_ will be replaced by the appropriate GIT_PROMPT_COMMAND_OK OR GIT_PROMPT_COMMAND_FAIL + GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${Yellow}${PathShort}${ResetColor}" + GIT_PROMPT_START_ROOT="_LAST_COMMAND_INDICATOR_ ${GIT_PROMPT_START_USER}" + GIT_PROMPT_END_USER=" \n${White}${Time12a}${ResetColor} $ " + GIT_PROMPT_END_ROOT=" \n${White}${Time12a}${ResetColor} # " + + # Please do not add colors to these symbols + GIT_PROMPT_SYMBOLS_AHEAD="↑·" # The symbol for "n versions ahead of origin" + GIT_PROMPT_SYMBOLS_BEHIND="↓·" # The symbol for "n versions behind of origin" + GIT_PROMPT_SYMBOLS_PREHASH=":" # Written before hash of commit, if no name could be found +} + +if [[ -z "$GIT_PROMPT_SEPARATOR" || -z "$GIT_PROMPT_COMMAND_OK" ]]; then + define_git_prompt_colors +fi diff --git a/themes/Solarized.bgptheme b/themes/Solarized.bgptheme index 9a936cf..7825fd2 100644 --- a/themes/Solarized.bgptheme +++ b/themes/Solarized.bgptheme @@ -1,4 +1,5 @@ -# This theme for gitprompt.sh is optimized for the "Solarized Dark" and "Solarized Light" color schemes +# This theme for gitprompt.sh is optimized for the "Solarized Dark" and "Solarized Light" color schemes +# tweaked for Ubuntu terminal fonts define_git_prompt_colors() { Time12a="\$(date +%H:%M)" @@ -26,7 +27,7 @@ define_git_prompt_colors() { # GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0 GIT_PROMPT_COMMAND_OK="${Green}✔" # indicator if the last command returned with an exit code of 0 - GIT_PROMPT_COMMAND_FAIL="${Red}✘" # indicator if the last command returned with an exit code of other than 0 + GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_" # indicator if the last command returned with an exit code of other than 0 # template for displaying the current virtual environment # use the placeholder _VIRTUALENV_ will be replaced with diff --git a/themes/Solarized_NoExitState.bgptheme b/themes/Solarized_NoExitState.bgptheme new file mode 100644 index 0000000..a2108d7 --- /dev/null +++ b/themes/Solarized_NoExitState.bgptheme @@ -0,0 +1,51 @@ +# This theme for gitprompt.sh is optimized for the "Solarized Dark" and "Solarized Light" color schemes +# without the indicator of the last command state + +define_git_prompt_colors() { + Time12a="\$(date +%H:%M)" + PathShort="\w" + + # These are the color definitions used by gitprompt.sh + GIT_PROMPT_PREFIX="[" # start of the git info string + GIT_PROMPT_SUFFIX="]" # the end of the git info string + GIT_PROMPT_SEPARATOR="|" # separates each item + + GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory + GIT_PROMPT_STAGED="${Yellow}●" # the number of staged files/directories + GIT_PROMPT_CONFLICTS="${Red}✖ " # the number of files in conflict + GIT_PROMPT_CHANGED="${Blue}✚ " # the number of changed files + + GIT_PROMPT_REMOTE=" " # the remote branch name (if any) and the symbols for ahead and behind + GIT_PROMPT_UNTRACKED="${Cyan}…" # the number of untracked files/dirs + GIT_PROMPT_STASHED="${BoldMagenta}⚑ " # the number of stashed files/dir + GIT_PROMPT_CLEAN="${Green}✔" # a colored flag indicating a "clean" repo + + # For the command indicator, the placeholder _LAST_COMMAND_STATE_ + # will be replaced with the exit code of the last command + # e.g. + # GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0 + # GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0 + + GIT_PROMPT_COMMAND_OK="${Green}✔" # indicator if the last command returned with an exit code of 0 + GIT_PROMPT_COMMAND_FAIL="${Red}✘" # indicator if the last command returned with an exit code of other than 0 + + # template for displaying the current virtual environment + # use the placeholder _VIRTUALENV_ will be replaced with + # the name of the current virtual environment (currently CONDA and VIRTUAL_ENV) + GIT_PROMPT_VIRTUALENV="(${Blue}_VIRTUALENV_${ResetColor}) " + + # _LAST_COMMAND_INDICATOR_ will be replaced by the appropriate GIT_PROMPT_COMMAND_OK OR GIT_PROMPT_COMMAND_FAIL + GIT_PROMPT_START_USER="${Yellow}${PathShort}${ResetColor}" + GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}" + GIT_PROMPT_END_USER=" \n${BoldBlue}${Time12a}${ResetColor} $ " + GIT_PROMPT_END_ROOT=" \n${BoldBlue}${Time12a}${ResetColor} # " + + # Please do not add colors to these symbols + GIT_PROMPT_SYMBOLS_AHEAD="↑·" # The symbol for "n versions ahead of origin" + GIT_PROMPT_SYMBOLS_BEHIND="↓·" # The symbol for "n versions behind of origin" + GIT_PROMPT_SYMBOLS_PREHASH=":" # Written before hash of commit, if no name could be found +} + +if [[ -z "$GIT_PROMPT_SEPARATOR" || -z "$GIT_PROMPT_COMMAND_OK" ]]; then + define_git_prompt_colors +fi diff --git a/themes/Solarized_NoExitState_Ubuntu.bgptheme b/themes/Solarized_NoExitState_Ubuntu.bgptheme new file mode 100644 index 0000000..d8cab5e --- /dev/null +++ b/themes/Solarized_NoExitState_Ubuntu.bgptheme @@ -0,0 +1,52 @@ +# This theme for gitprompt.sh is optimized for the "Solarized Dark" and "Solarized Light" color schemes +# without the indicator of the last command state +# tweaked for Ubuntu terminal fonts + +define_git_prompt_colors() { + Time12a="\$(date +%H:%M)" + PathShort="\w" + + # These are the color definitions used by gitprompt.sh + GIT_PROMPT_PREFIX="[" # start of the git info string + GIT_PROMPT_SUFFIX="]" # the end of the git info string + GIT_PROMPT_SEPARATOR="|" # separates each item + + GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory + GIT_PROMPT_STAGED="${Yellow}● " # the number of staged files/directories + GIT_PROMPT_CONFLICTS="${Red}✖ " # the number of files in conflict + GIT_PROMPT_CHANGED="${Blue}✚ " # the number of changed files + + GIT_PROMPT_REMOTE=" " # the remote branch name (if any) and the symbols for ahead and behind + GIT_PROMPT_UNTRACKED="${Cyan}… " # the number of untracked files/dirs + GIT_PROMPT_STASHED="${BoldMagenta}⚑ " # the number of stashed files/dir + GIT_PROMPT_CLEAN="${Green}✔ " # a colored flag indicating a "clean" repo + + # For the command indicator, the placeholder _LAST_COMMAND_STATE_ + # will be replaced with the exit code of the last command + # e.g. + # GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0 + # GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0 + + GIT_PROMPT_COMMAND_OK="${Green}✔ " # indicator if the last command returned with an exit code of 0 + GIT_PROMPT_COMMAND_FAIL="${Red}✘ " # indicator if the last command returned with an exit code of other than 0 + + # template for displaying the current virtual environment + # use the placeholder _VIRTUALENV_ will be replaced with + # the name of the current virtual environment (currently CONDA and VIRTUAL_ENV) + GIT_PROMPT_VIRTUALENV="(${Blue}_VIRTUALENV_${ResetColor}) " + + # _LAST_COMMAND_INDICATOR_ will be replaced by the appropriate GIT_PROMPT_COMMAND_OK OR GIT_PROMPT_COMMAND_FAIL + GIT_PROMPT_START_USER="${Yellow}${PathShort}${ResetColor}" + GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}" + GIT_PROMPT_END_USER=" \n${BoldBlue}${Time12a}${ResetColor} $ " + GIT_PROMPT_END_ROOT=" \n${BoldBlue}${Time12a}${ResetColor} # " + + # Please do not add colors to these symbols + GIT_PROMPT_SYMBOLS_AHEAD="↑·" # The symbol for "n versions ahead of origin" + GIT_PROMPT_SYMBOLS_BEHIND="↓·" # The symbol for "n versions behind of origin" + GIT_PROMPT_SYMBOLS_PREHASH=":" # Written before hash of commit, if no name could be found +} + +if [[ -z "$GIT_PROMPT_SEPARATOR" || -z "$GIT_PROMPT_COMMAND_OK" ]]; then + define_git_prompt_colors +fi diff --git a/themes/Solarized_Ubuntu.bgptheme b/themes/Solarized_Ubuntu.bgptheme new file mode 100644 index 0000000..3b7b146 --- /dev/null +++ b/themes/Solarized_Ubuntu.bgptheme @@ -0,0 +1,51 @@ +# This theme for gitprompt.sh is optimized for the "Solarized Dark" and "Solarized Light" color schemes +# tweaked for Ubuntu terminal fonts + +define_git_prompt_colors() { + Time12a="\$(date +%H:%M)" + PathShort="\w" + + # These are the color definitions used by gitprompt.sh + GIT_PROMPT_PREFIX="[" # start of the git info string + GIT_PROMPT_SUFFIX="]" # the end of the git info string + GIT_PROMPT_SEPARATOR="|" # separates each item + + GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory + GIT_PROMPT_STAGED="${Yellow}● " # the number of staged files/directories + GIT_PROMPT_CONFLICTS="${Red}✖ " # the number of files in conflict + GIT_PROMPT_CHANGED="${Blue}✚ " # the number of changed files + + GIT_PROMPT_REMOTE=" " # the remote branch name (if any) and the symbols for ahead and behind + GIT_PROMPT_UNTRACKED="${Cyan}… " # the number of untracked files/dirs + GIT_PROMPT_STASHED="${BoldMagenta}⚑ " # the number of stashed files/dir + GIT_PROMPT_CLEAN="${Green}✔ " # a colored flag indicating a "clean" repo + + # For the command indicator, the placeholder _LAST_COMMAND_STATE_ + # will be replaced with the exit code of the last command + # e.g. + # GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0 + # GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0 + + GIT_PROMPT_COMMAND_OK="${Green}✔ " # indicator if the last command returned with an exit code of 0 + GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_" # indicator if the last command returned with an exit code of other than 0 + + # template for displaying the current virtual environment + # use the placeholder _VIRTUALENV_ will be replaced with + # the name of the current virtual environment (currently CONDA and VIRTUAL_ENV) + GIT_PROMPT_VIRTUALENV="(${Blue}_VIRTUALENV_${ResetColor}) " + + # _LAST_COMMAND_INDICATOR_ will be replaced by the appropriate GIT_PROMPT_COMMAND_OK OR GIT_PROMPT_COMMAND_FAIL + GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${Yellow}${PathShort}${ResetColor}" + GIT_PROMPT_START_ROOT="_LAST_COMMAND_INDICATOR_ ${GIT_PROMPT_START_USER}" + GIT_PROMPT_END_USER=" \n${BoldBlue}${Time12a}${ResetColor} $ " + GIT_PROMPT_END_ROOT=" \n${BoldBlue}${Time12a}${ResetColor} # " + + # Please do not add colors to these symbols + GIT_PROMPT_SYMBOLS_AHEAD="↑·" # The symbol for "n versions ahead of origin" + GIT_PROMPT_SYMBOLS_BEHIND="↓·" # The symbol for "n versions behind of origin" + GIT_PROMPT_SYMBOLS_PREHASH=":" # Written before hash of commit, if no name could be found +} + +if [[ -z "$GIT_PROMPT_SEPARATOR" || -z "$GIT_PROMPT_COMMAND_OK" ]]; then + define_git_prompt_colors +fi