My dotfiles. Period.

colors.bashrc 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/bash
  2. #
  3. # Context symbol used in title and prompt
  4. #
  5. BASHUM_CTXSYM=${BASHUM_CTXSYM:-}
  6. # get some fancy colorz
  7. BASHUM_COLOR_BLACK=$'\033[0;30m'
  8. BASHUM_COLOR_RED=$'\033[0;31m'
  9. BASHUM_COLOR_GREEN=$'\033[0;32m'
  10. BASHUM_COLOR_YELLOW=$'\033[0;33m'
  11. BASHUM_COLOR_BLUE=$'\033[0;34m'
  12. BASHUM_COLOR_MAGENTA=$'\033[0;35m'
  13. BASHUM_COLOR_CYAN=$'\033[0;36m'
  14. BASHUM_COLOR_WHITE=$'\033[0;37m'
  15. BASHUM_COLOR_LBLACK=$'\033[1;30m'
  16. BASHUM_COLOR_LRED=$'\033[1;31m'
  17. BASHUM_COLOR_LGREEN=$'\033[1;32m'
  18. BASHUM_COLOR_LYELLOW=$'\033[1;33m'
  19. BASHUM_COLOR_LBLUE=$'\033[1;34m'
  20. BASHUM_COLOR_LMAGENTA=$'\033[1;35m'
  21. BASHUM_COLOR_LCYAN=$'\033[1;36m'
  22. BASHUM_COLOR_LWHITE=$'\033[1;37m'
  23. BASHUM_COLOR_NORMAL=$'\033[1;0m'
  24. # get some fancy colorz
  25. BASHUM_PS_COLOR_BLACK=$'\[\033[0;30m\]'
  26. BASHUM_PS_COLOR_RED=$'\[\033[0;31m\]'
  27. BASHUM_PS_COLOR_GREEN=$'\[\033[0;32m\]'
  28. BASHUM_PS_COLOR_YELLOW=$'\[\033[0;33m\]'
  29. BASHUM_PS_COLOR_BLUE=$'\[\033[0;34m\]'
  30. BASHUM_PS_COLOR_MAGENTA=$'\[\033[0;35m\]'
  31. BASHUM_PS_COLOR_CYAN=$'\[\033[0;36m\]'
  32. BASHUM_PS_COLOR_WHITE=$'\[\033[0;37m\]'
  33. BASHUM_PS_COLOR_LBLACK=$'\[\033[1;30m\]'
  34. BASHUM_PS_COLOR_LRED=$'\[\033[1;31m\]'
  35. BASHUM_PS_COLOR_LGREEN=$'\[\033[1;32m\]'
  36. BASHUM_PS_COLOR_LYELLOW=$'\[\033[1;33m\]'
  37. BASHUM_PS_COLOR_LBLUE=$'\[\033[1;34m\]'
  38. BASHUM_PS_COLOR_LMAGENTA=$'\[\033[1;35m\]'
  39. BASHUM_PS_COLOR_LCYAN=$'\[\033[1;36m\]'
  40. BASHUM_PS_COLOR_LWHITE=$'\[\033[1;37m\]'
  41. BASHUM_PS_COLOR_NORMAL=$'\[\033[1;0m\]'
  42. #shellcheck disable=SC1087
  43. bashum__colordemo() {
  44. local bla=$BASHUM_COLOR_BLACK
  45. local red=$BASHUM_COLOR_RED
  46. local gre=$BASHUM_COLOR_GREEN
  47. local yel=$BASHUM_COLOR_YELLOW
  48. local blu=$BASHUM_COLOR_BLUE
  49. local mag=$BASHUM_COLOR_MAGENTA
  50. local cya=$BASHUM_COLOR_CYAN
  51. local whi=$BASHUM_COLOR_WHITE
  52. local lbla=$BASHUM_COLOR_LBLACK
  53. local lred=$BASHUM_COLOR_LRED
  54. local lgre=$BASHUM_COLOR_LGREEN
  55. local lyel=$BASHUM_COLOR_LYELLOW
  56. local lblu=$BASHUM_COLOR_LBLUE
  57. local lmag=$BASHUM_COLOR_LMAGENTA
  58. local lcya=$BASHUM_COLOR_LCYAN
  59. local lwhi=$BASHUM_COLOR_LWHITE
  60. local n=$BASHUM_COLOR_NORMAL
  61. echo "black: $bla[abc123]$n lblack: $lbla[abc123]$n"
  62. echo "red: $red[abc123]$n lred: $lred[abc123]$n"
  63. echo "yellow: $yel[abc123]$n lyellow: $lyel[abc123]$n"
  64. echo "green: $gre[abc123]$n lgreen: $lgre[abc123]$n"
  65. echo "cyan: $cya[abc123]$n lcyan: $lcya[abc123]$n"
  66. echo "blue: $blu[abc123]$n lblue: $lblu[abc123]$n"
  67. echo "magenta: $mag[abc123]$n lmagenta: $lmag[abc123]$n"
  68. echo "white: $whi[abc123]$n lwhite: $lwhi[abc123]$n"
  69. }