rose-pine.sh 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #{
  2. # Shell Color Setup Template
  3. # Chris Kempson (http://chriskempson.com)
  4. #}#!/bin/sh
  5. # Base16 Rosé Pine - Shell color setup script
  6. # Emilia Dunfelt <edun@dunfelt.se>
  7. if [ "${TERM%%-*}" = 'linux' ]; then
  8. # This script doesn't support linux console (use 'vconsole' template instead)
  9. return 2>/dev/null || exit 0
  10. fi
  11. color00="19/17/24" # Base 00 - Black
  12. color01="eb/6f/92" # Base 08 - Red
  13. color02="31/74/8f" # Base 0B - Green
  14. color03="eb/bc/ba" # Base 0A - Yellow
  15. color04="c4/a7/e7" # Base 0D - Blue
  16. color05="f6/c1/77" # Base 0E - Magenta
  17. color06="9c/cf/d8" # Base 0C - Cyan
  18. color07="e0/de/f4" # Base 05 - White
  19. color08="6e/6a/86" # Base 03 - Bright Black
  20. color09=$color01 # Base 08 - Bright Red
  21. color10=$color02 # Base 0B - Bright Green
  22. color11=$color03 # Base 0A - Bright Yellow
  23. color12=$color04 # Base 0D - Bright Blue
  24. color13=$color05 # Base 0E - Bright Magenta
  25. color14=$color06 # Base 0C - Bright Cyan
  26. color15="52/4f/67" # Base 07 - Bright White
  27. color16="f6/c1/77" # Base 09
  28. color17="52/4f/67" # Base 0F
  29. color18="1f/1d/2e" # Base 01
  30. color19="26/23/3a" # Base 02
  31. color20="90/8c/aa" # Base 04
  32. color21="e0/de/f4" # Base 06
  33. color_foreground="e0/de/f4" # Base 05
  34. color_background="19/17/24" # Base 00
  35. color_cursor="e0/de/f4" # Base 05
  36. if [ -n "$TMUX" ]; then
  37. # tell tmux to pass the escape sequences through
  38. # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
  39. printf_template="\033Ptmux;\033\033]4;%d;rgb:%s\007\033\\"
  40. printf_template_var="\033Ptmux;\033\033]%d;rgb:%s\007\033\\"
  41. printf_template_custom="\033Ptmux;\033\033]%s%s\007\033\\"
  42. elif [ "${TERM%%-*}" = "screen" ]; then
  43. # GNU screen (screen, screen-256color, screen-256color-bce)
  44. printf_template="\033P\033]4;%d;rgb:%s\007\033\\"
  45. printf_template_var="\033P\033]%d;rgb:%s\007\033\\"
  46. printf_template_custom="\033P\033]%s%s\007\033\\"
  47. elif [ -n "${-##*i*}" ]; then
  48. # non-interactive
  49. alias printf=/bin/false
  50. else
  51. printf_template="\033]4;%d;rgb:%s\033\\"
  52. printf_template_var="\033]%d;rgb:%s\033\\"
  53. printf_template_custom="\033]%s%s\033\\"
  54. fi
  55. # 16 color space
  56. printf $printf_template 0 $color00
  57. printf $printf_template 1 $color01
  58. printf $printf_template 2 $color02
  59. printf $printf_template 3 $color03
  60. printf $printf_template 4 $color04
  61. printf $printf_template 5 $color05
  62. printf $printf_template 6 $color06
  63. printf $printf_template 7 $color07
  64. printf $printf_template 8 $color08
  65. printf $printf_template 9 $color09
  66. printf $printf_template 10 $color10
  67. printf $printf_template 11 $color11
  68. printf $printf_template 12 $color12
  69. printf $printf_template 13 $color13
  70. printf $printf_template 14 $color14
  71. printf $printf_template 15 $color15
  72. # 256 color space
  73. printf $printf_template 16 $color16
  74. printf $printf_template 17 $color17
  75. printf $printf_template 18 $color18
  76. printf $printf_template 19 $color19
  77. printf $printf_template 20 $color20
  78. printf $printf_template 21 $color21
  79. # foreground / background / cursor color
  80. if [ -n "$ITERM_SESSION_ID" ]; then
  81. # iTerm2 proprietary escape codes
  82. printf $printf_template_custom Pg e0def4 # forground
  83. printf $printf_template_custom Ph 191724 # background
  84. printf $printf_template_custom Pi e0def4 # bold color
  85. printf $printf_template_custom Pj 26233a # selection color
  86. printf $printf_template_custom Pk e0def4 # selected text color
  87. printf $printf_template_custom Pl e0def4 # cursor
  88. printf $printf_template_custom Pm 191724 # cursor text
  89. else
  90. printf $printf_template_var 10 $color_foreground
  91. printf $printf_template_var 11 $color_background
  92. printf $printf_template_custom 12 ";7" # cursor (reverse video)
  93. fi
  94. # clean up
  95. unset printf_template
  96. unset printf_template_var
  97. unset color00
  98. unset color01
  99. unset color02
  100. unset color03
  101. unset color04
  102. unset color05
  103. unset color06
  104. unset color07
  105. unset color08
  106. unset color09
  107. unset color10
  108. unset color11
  109. unset color12
  110. unset color13
  111. unset color14
  112. unset color15
  113. unset color16
  114. unset color17
  115. unset color18
  116. unset color19
  117. unset color20
  118. unset color21
  119. unset color_foreground
  120. unset color_background
  121. unset color_cursor