Minimal_Chevron.bgptheme 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ##############################################################################
  2. # Changes the prompt to a Debian-style one that truncates pwd to a max length
  3. # depending on the terminal column width. Also uses the prompt_callback
  4. # function of bash-git-prompt to set the window title to almost the same
  5. # Debian-style. This version has been tweaked for Ubuntu standard terminal
  6. # fonts.
  7. #
  8. # The prompt will use a Debian-style on the form
  9. #
  10. # relative-path-from-git-toplevel-dir bash-git-prompt-info <exit status>
  11. # HH:MM ▶
  12. #
  13. # ● ✖ ◆ ➤ ▶ ❚❖ ⬅ ◀ ✔ ✘ ⬆ ⬇ ✚ ❮❮ ❯❯ ✦ ✛ ✲
  14. #
  15. # The window title will have the form
  16. # relative-path-from-git-toplevel-dir
  17. #
  18. # Example usage:
  19. # if [ -f ~/.bash-git-prompt/gitprompt.sh ]; then
  20. # GIT_PROMPT_THEME=Minimal_Time
  21. # source ~/.bash-git-prompt/gitprompt.sh
  22. # fi
  23. #
  24. # [https://github.com/modib]
  25. ##############################################################################
  26. override_git_prompt_colors() {
  27. GIT_PROMPT_THEME_NAME="Minimal_Time"
  28. #Overrides the prompt_callback function used by bash-git-prompt
  29. function prompt_callback {
  30. GIT_CONTAINER_FOLDER_FULLPATH=$(git rev-parse --show-toplevel 2> /dev/null)
  31. GIT_CONTAINER_FOLDER=$(basename $GIT_CONTAINER_FOLDER_FULLPATH 2> /dev/null)
  32. CURRENT_FULLPATH=$(pwd)
  33. local PS1=$GIT_CONTAINER_FOLDER${CURRENT_FULLPATH#$GIT_CONTAINER_FOLDER_FULLPATH}
  34. gp_set_window_title "$PS1"
  35. echo "${Cyan}${PS1}${ResetColor}"
  36. }
  37. Time12a="\$(date +%H:%M)"
  38. GIT_PROMPT_BRANCH="${Magenta}" # the git branch that is active in the current directory
  39. GIT_PROMPT_MASTER_BRANCH="${White}" # used if the git branch that is active in the current directory is $GIT_PROMPT_MASTER_BRANCHES
  40. GIT_PROMPT_PREFIX="["
  41. GIT_PROMPT_SUFFIX="]"
  42. GIT_PROMPT_SEPARATOR="" # separates each item
  43. GIT_PROMPT_STAGED=" ${Green}●" # the number of staged files/directories
  44. GIT_PROMPT_CONFLICTS=" ${Red}❮❮" # the number of files in conflict
  45. GIT_PROMPT_CHANGED=" ${Yellow}✚." # the number of changed files
  46. GIT_PROMPT_REMOTE=" " # the remote branch name (if any) and the symbols for ahead and behind
  47. GIT_PROMPT_UNTRACKED=" ${Cyan}…" # the number of untracked files/dirs
  48. GIT_PROMPT_STASHED=" ${Cyan}⚑" # the number of stashed files/dir
  49. GIT_PROMPT_CLEAN=" ${Green}❯❯" # a colored flag indicating a "clean" repo
  50. GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING="${Red}✭"
  51. GIT_PROMPT_COMMAND_OK="${Green}❯❯" # 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. local gp_start="_LAST_COMMAND_INDICATOR_"
  54. local gp_end="\n${White}${Time12a}${ResetColor} ❯❯"
  55. GIT_PROMPT_START_USER="\n${gp_start} "
  56. GIT_PROMPT_END_USER="${gp_end} "
  57. #GIT_PROMPT_SYMBOLS_AHEAD="↑·"
  58. GIT_PROMPT_SYMBOLS_AHEAD="⬆."
  59. #GIT_PROMPT_SYMBOLS_BEHIND="↓·"
  60. GIT_PROMPT_SYMBOLS_BEHIND="⬇."
  61. }
  62. reload_git_prompt_colors "Minimal_Time"