Default.bgptheme 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # This is the default theme for gitprompt.sh
  2. unset_git_prompt_colors() {
  3. unset Time12a
  4. unset PathShort
  5. unset GIT_PROMPT_PREFIX
  6. unset GIT_PROMPT_SUFFIX
  7. unset GIT_PROMPT_SEPARATOR
  8. unset GIT_PROMPT_BRANCH
  9. unset GIT_PROMPT_STAGED
  10. unset GIT_PROMPT_CONFLICTS
  11. unset GIT_PROMPT_CHANGED
  12. unset GIT_PROMPT_REMOTE
  13. unset GIT_PROMPT_UNTRACKED
  14. unset GIT_PROMPT_STASHED
  15. unset GIT_PROMPT_CLEAN
  16. unset GIT_PROMPT_COMMAND_OK
  17. unset GIT_PROMPT_COMMAND_FAIL
  18. unset GIT_PROMPT_VIRTUALENV
  19. unset GIT_PROMPT_UPSTREAM
  20. unset GIT_PROMPT_START_USER
  21. unset GIT_PROMPT_START_ROOT
  22. unset GIT_PROMPT_END_USER
  23. unset GIT_PROMPT_END_ROOT
  24. unset GIT_PROMPT_SYMBOLS_AHEAD
  25. unset GIT_PROMPT_SYMBOLS_BEHIND
  26. unset GIT_PROMPT_SYMBOLS_PREHASH
  27. unset GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING
  28. }
  29. define_helpers() {
  30. Time12a="\$(date +%H:%M)"
  31. PathShort="\w";
  32. }
  33. define_undefined_git_prompt_colors() {
  34. if [ -z ${GIT_PROMPT_THEME_NAME:+x} ]; then GIT_PROMPT_THEME_NAME="Default"; fi
  35. # These are the color definitions used by gitprompt.sh
  36. if [ -z "${GIT_PROMPT_PREFIX+x}" ]; then GIT_PROMPT_PREFIX="["; fi # start of the git info string
  37. if [ -z "${GIT_PROMPT_SUFFIX+x}" ]; then GIT_PROMPT_SUFFIX="]"; fi # the end of the git info string
  38. if [ -z "${GIT_PROMPT_SEPARATOR+x}" ]; then GIT_PROMPT_SEPARATOR="|"; fi # separates each item
  39. if [ -z "${GIT_PROMPT_BRANCH+x}" ]; then GIT_PROMPT_BRANCH="${Magenta}"; fi # the git branch that is active in the current directory
  40. if [ -z "${GIT_PROMPT_MASTER_BRANCH+x}" ]; then GIT_PROMPT_MASTER_BRANCH="${GIT_PROMPT_BRANCH}"; fi # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES
  41. if [ -z "${GIT_PROMPT_STAGED+x}" ]; then GIT_PROMPT_STAGED="${Red}●"; fi # the number of staged files/directories
  42. if [ -z "${GIT_PROMPT_CONFLICTS+x}" ]; then GIT_PROMPT_CONFLICTS="${Red}✖ "; fi # the number of files in conflict
  43. if [ -z "${GIT_PROMPT_CHANGED+x}" ]; then GIT_PROMPT_CHANGED="${Blue}✚ "; fi # the number of changed files
  44. if [ -z "${GIT_PROMPT_REMOTE+x}" ]; then GIT_PROMPT_REMOTE=" "; fi # the remote branch name (if any) and the symbols for ahead and behind
  45. if [ -z "${GIT_PROMPT_UNTRACKED+x}" ]; then GIT_PROMPT_UNTRACKED="${Cyan}…"; fi # the number of untracked files/dirs
  46. if [ -z "${GIT_PROMPT_STASHED+x}" ]; then GIT_PROMPT_STASHED="${BoldBlue}⚑ "; fi # the number of stashed files/dir
  47. if [ -z "${GIT_PROMPT_CLEAN+x}" ]; then GIT_PROMPT_CLEAN="${BoldGreen}✔"; fi # a colored flag indicating a "clean" repo
  48. # For the command indicator, the placeholder _LAST_COMMAND_STATE_
  49. # will be replaced with the exit code of the last command
  50. # e.g.
  51. # GIT_PROMPT_COMMAND_OK="${Green}✔-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of 0
  52. # GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # indicator if the last command returned with an exit code of other than 0
  53. if [ -z "${GIT_PROMPT_COMMAND_OK+x}" ]; then GIT_PROMPT_COMMAND_OK="${Green}✔"; fi # indicator if the last command returned with an exit code of 0
  54. if [ -z "${GIT_PROMPT_COMMAND_FAIL+x}" ]; then GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_"; fi # indicator if the last command returned with an exit code of other than 0
  55. # Possible to change which command is used to create git status information
  56. # There are three options:
  57. # 1) gitstatus.sh (uses git status --branch --porcelain - fast, requires git > 1.7.10)
  58. # 2) gitstatus_pre-1.7.10.sh (Uses a variety of git commands and pipes - slower, works with older git clients)
  59. # 3) gitstatus.py (Unsupported, lack features found in the bash versions)
  60. if [ -z "${GIT_PROMPT_STATUS_COMMAND+x}" ]; then GIT_PROMPT_STATUS_COMMAND="gitstatus.sh"; fi # Point out the command to get the git status from
  61. # template for displaying the current virtual environment
  62. # use the placeholder _VIRTUALENV_ will be replaced with
  63. # the name of the current virtual environment (currently CONDA and VIRTUAL_ENV)
  64. if [ -z "${GIT_PROMPT_VIRTUALENV+x}" ]; then GIT_PROMPT_VIRTUALENV="(${Blue}_VIRTUALENV_${ResetColor}) "; fi
  65. # template for displaying the current remote tracking branch
  66. # use the placeholder _UPSTREAM_ will be replaced with
  67. # the name of the current remote tracking branch
  68. if [ -z "${GIT_PROMPT_UPSTREAM+x}" ]; then GIT_PROMPT_UPSTREAM=" {${Blue}_UPSTREAM_${ResetColor}}"; fi
  69. # _LAST_COMMAND_INDICATOR_ will be replaced by the appropriate GIT_PROMPT_COMMAND_OK OR GIT_PROMPT_COMMAND_FAIL
  70. if [ -z "${GIT_PROMPT_START_USER+x}" ]; then GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${Yellow}${PathShort}${ResetColor}"; fi
  71. if [ -z "${GIT_PROMPT_START_ROOT+x}" ]; then GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}"; fi
  72. if [ -z "${GIT_PROMPT_END_USER+x}" ]; then GIT_PROMPT_END_USER=" \n${White}${Time12a}${ResetColor} $ "; fi
  73. if [ -z "${GIT_PROMPT_END_ROOT+x}" ]; then GIT_PROMPT_END_ROOT=" \n${White}${Time12a}${ResetColor} # "; fi
  74. # Please do not add colors to these symbols
  75. if [ -z ${GIT_PROMPT_SYMBOLS_AHEAD+x} ]; then GIT_PROMPT_SYMBOLS_AHEAD="↑·"; fi # The symbol for "n versions ahead of origin"
  76. if [ -z ${GIT_PROMPT_SYMBOLS_BEHIND+x} ]; then GIT_PROMPT_SYMBOLS_BEHIND="↓·"; fi # The symbol for "n versions behind of origin"
  77. if [ -z ${GIT_PROMPT_SYMBOLS_PREHASH+x} ]; then GIT_PROMPT_SYMBOLS_PREHASH=":"; fi # Written before hash of commit, if no name could be found
  78. if [ -z ${GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING+x} ]; then GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="L"; fi # This symbol is written after the branch, if the branch is not tracked
  79. # branch name(s) that will use $GIT_PROMPT_MASTER_BRANCH color
  80. # To specify multiple branches, use
  81. # shopt -s extglob
  82. # GIT_PROMPT_MASTER_BRANCHES='@(master|production)'
  83. if [ -z ${GIT_PROMPT_MASTER_BRANCHES+x} ]; then GIT_PROMPT_MASTER_BRANCHES="master"; fi
  84. }
  85. # call only from theme file
  86. reload_git_prompt_colors() {
  87. if [[ "${GIT_PROMPT_THEME_NAME-}" != "${1}" ]]; then
  88. unset_git_prompt_colors
  89. define_helpers
  90. override_git_prompt_colors
  91. define_undefined_git_prompt_colors
  92. fi
  93. }
  94. if [[ "${GIT_PROMPT_THEME-}" == "Default" && "${GIT_PROMPT_THEME_NAME-}" != "Default" ]]; then
  95. define_helpers
  96. define_undefined_git_prompt_colors
  97. fi