summaryrefslogtreecommitdiffstats
path: root/fish/functions/bobthefish_display_colors.fish
blob: 39c025f4822459e229c587f483eee7922fe220ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
function bobthefish_display_colors -a color_scheme -d 'Print example prompt color schemes'

  set -l color_schemes default light \
    solarized solarized-light \
    base16 base16-light \
    gruvbox gruvbox-light zenburn \
    dracula nord \
    catppuccin-latte catppuccin-frappe \
    catppuccin-macchiato catppuccin-mocha \
    jellybeans \
    terminal terminal-dark-white \
    terminal-light terminal-light-black \
    terminal2 terminal2-dark-white \
    terminal2-light terminal2-light-black

  switch "$color_scheme"
    case '--all'
      for scheme in $color_schemes
        echo
        echo "$scheme:"
        bobthefish_display_colors $scheme
      end
      return

    case $color_schemes
      __bobthefish_colors $color_scheme

    case ''
      if type -q bobthefish_colors
        if [ -n "$theme_color_scheme" ]
          echo "$theme_color_scheme (with bobthefish_colors overrides):"
        else
          echo 'custom (via bobthefish_colors):'
        end
      else if [ -n "$theme_color_scheme" ]
        echo "$theme_color_scheme:"
      end

      __bobthefish_colors $theme_color_scheme
      type -q bobthefish_colors
        and bobthefish_colors

    case '*'
      echo 'usage: bobthefish_display_colors [--all] [color_scheme]'
      return
  end

  __bobthefish_glyphs

  echo
  set_color normal

  __bobthefish_start_segment $color_initial_segment_exit
  echo -n exit $nonzero_exit_glyph
  set_color -b $color_initial_segment_private
  echo -n private $private_glyph
  set_color -b $color_initial_segment_su
  echo -n su $superuser_glyph
  set_color -b $color_initial_segment_jobs
  echo -n jobs $bg_job_glyph
  __bobthefish_finish_segments
  set_color normal
  echo -n "(<- initial_segment)"
  echo

  __bobthefish_start_segment $color_path
  echo -n /color/path/
  set_color -b $color_path_basename
  echo -ns basename ' '
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_path_nowrite
  echo -n /color/path/nowrite/
  set_color -b $color_path_nowrite_basename
  echo -ns basename ' '
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_path
  echo -n /color/path/
  set_color -b $color_path_basename
  echo -ns basename ' '
  __bobthefish_start_segment $color_repo
  echo -n "$branch_glyph repo $git_stashed_glyph "
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_path
  echo -n /color/path/
  set_color -b $color_path_basename
  echo -ns basename ' '
  __bobthefish_start_segment $color_repo_dirty
  echo -n "$tag_glyph repo_dirty $git_dirty_glyph "
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_path
  echo -n /color/path/
  set_color -b $color_path_basename
  echo -ns basename ' '
  __bobthefish_start_segment $color_repo_staged
  echo -n "$detached_glyph repo_staged $git_staged_glyph "
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_vi_mode_default
  echo -ns vi_mode_default ' '
  __bobthefish_finish_segments
  __bobthefish_start_segment $color_vi_mode_insert
  echo -ns vi_mode_insert ' '
  __bobthefish_finish_segments
  __bobthefish_start_segment $color_vi_mode_visual
  echo -ns vi_mode_visual ' '
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_vagrant
  echo -ns $vagrant_running_glyph ' ' vagrant ' '
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_username
  echo -n username
  set_color normal
  set_color -b $color_hostname[1] $color_hostname[2..-1]
  echo -ns @hostname ' '
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_screen
  echo -ns 'screen '
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_rvm
  echo -ns $ruby_glyph rvm ' '
  __bobthefish_finish_segments

  __bobthefish_start_segment $color_nvm
  echo -ns $ruby_glyph nvm ' '
  __bobthefish_finish_segments

  __bobthefish_start_segment $color_virtualfish
  echo -ns $virtualenv_glyph virtualfish ' '
  __bobthefish_finish_segments

  __bobthefish_start_segment $color_virtualgo
  echo -ns $go_glyph virtualgo ' '
  __bobthefish_finish_segments

  __bobthefish_start_segment $color_desk
  echo -ns $desk_glyph desk ' '
  __bobthefish_finish_segments
  echo

  __bobthefish_start_segment $color_aws_vault
  echo -ns aws-vault ' (' active ') '
  __bobthefish_finish_segments

  __bobthefish_start_segment $color_aws_vault_expired
  echo -ns aws-vault ' (' expired ') '
  __bobthefish_finish_segments

  __bobthefish_start_segment $color_k8s
  echo -ns $k8s_glyph ' k8s-context'
  __bobthefish_finish_segments

  echo -e "\n"
end