Add rainbow configuration menus

This commit is contained in:
Ilan Cosman 2020-07-08 09:58:39 -07:00
parent c456a7647b
commit 33e91ef45a
17 changed files with 474 additions and 14 deletions

View File

@ -1,15 +1,18 @@
function _tide_item_status
if string match -q --invert '0' $_tide_last_pipestatus # If there is a failure somewhere in the pipestatus
if test $_tide_last_status -eq 0
set -g tide_status_bg_color $tide_status_success_bg_color
set_color $tide_status_success_color
printf '%s' {$tide_status_success_icon}' '
else
set -g tide_status_bg_color $tide_status_failure_bg_color
set_color $tide_status_failure_color
printf '%s' {$tide_status_failure_icon}' '
end
__fish_pipestatus_with_signal $_tide_last_pipestatus | string replace -a 'SIG' '' | string join '|'
__fish_pipestatus_with_signal $_tide_last_pipestatus | string replace 'SIG' '' | string join '|'
else if test "$tide_status_always_display_icon" = 'true'
set -g tide_status_bg_color $tide_status_success_bg_color
set_color $tide_status_success_color
printf '%s' $tide_status_success_icon
end

View File

@ -9,13 +9,17 @@ function style
_load_config 'classic'
_display_prompt
_option 3 'Pure'
_option 3 'Rainbow'
_load_config 'rainbow'
_display_prompt
_option 4 'Pure'
_load_config 'pure'
_display_prompt
_display_restart_and_quit
switch (_menu 'Choice' 1/2/3/r/q)
switch (_menu 'Choice' 1/2/3/4/r/q)
case 1
_load_config lean
_next_choice 'lean/lean_show_time'
@ -23,6 +27,9 @@ function style
_load_config classic
_next_choice 'classic/classic_prompt_color'
case 3
_load_config rainbow
_next_choice 'rainbow/rainbow_show_time'
case 4
_load_config pure
_next_choice 'pure/pure_nonperm_content_location'
case r

View File

@ -45,7 +45,8 @@ function _set_all_items_bg_color -a color
set fake_tide_git_prompt_bg_color $color
set fake_tide_jobs_bg_color $color
set fake_tide_pwd_bg_color $color
set fake_tide_status_bg_color $color
set fake_tide_status_success_bg_color $color
set fake_tide_status_failure_bg_color $color
set fake_tide_time_bg_color $color
set fake_tide_virtual_env_bg_color $color
end

View File

@ -0,0 +1,40 @@
function classic_prompt_connection_color
_title 'Connection Color'
_option 1 'Lightest'
set -g fake_tide_prompt_connection_color 808080
_display_prompt
_option 2 'Light'
set -g fake_tide_prompt_connection_color 6C6C6C
_display_prompt
_option 3 'Dark'
set -g fake_tide_prompt_connection_color 585858
_display_prompt
_option 4 'Darkest'
set -g fake_tide_prompt_connection_color 444444
_display_prompt
_display_restart_and_quit
switch (_menu 'Choice' 1/2/3/4/r/q)
case 1
set -g fake_tide_prompt_connection_color 808080
_next_choice 'all/prompt_spacing'
case 2
set -g fake_tide_prompt_connection_color 6C6C6C
_next_choice 'all/prompt_spacing'
case 3
set -g fake_tide_prompt_connection_color 585858
_next_choice 'all/prompt_spacing'
case 4
set -g fake_tide_prompt_connection_color 444444
_next_choice 'all/prompt_spacing'
case r
_begin
case q
_quit
end
end

View File

@ -32,20 +32,20 @@ function classic_prompt_frame
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled false
set -a fake_tide_left_prompt_items prompt_char
_next_choice 'all/prompt_spacing'
_next_choice 'classic/classic_prompt_connection_and_frame_color'
case 2
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled false
_next_choice 'all/prompt_spacing'
_next_choice 'classic/classic_prompt_connection_and_frame_color'
case 3
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled true
set -a fake_tide_left_prompt_items prompt_char
_next_choice 'all/prompt_spacing'
_next_choice 'classic/classic_prompt_connection_and_frame_color'
case 4
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled true
_next_choice 'all/prompt_spacing'
_next_choice 'classic/classic_prompt_connection_and_frame_color'
case r
_begin
case q

View File

@ -0,0 +1,30 @@
function rainbow_prompt_connection
_title 'Prompt Connection'
_option 1 'Disconnected'
_display_prompt fake_tide_prompt_connection_icon ' '
_option 2 'Dotted'
_display_prompt fake_tide_prompt_connection_icon '·'
_option 3 'Solid'
_display_prompt fake_tide_prompt_connection_icon '─'
_display_restart_and_quit
switch (_menu 'Choice' 1/2/3/r/q)
case 1
set -g fake_tide_prompt_connection_icon ' '
_next_choice 'rainbow/rainbow_prompt_frame'
case 2
set -g fake_tide_prompt_connection_icon '·'
_next_choice 'rainbow/rainbow_prompt_frame'
case 3
set -g fake_tide_prompt_connection_icon '─'
_next_choice 'rainbow/rainbow_prompt_frame'
case r
_begin
case q
_quit
end
end

View File

@ -0,0 +1,54 @@
function rainbow_prompt_frame
_title 'Prompt Frame'
_option 1 'No frame'
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled false
set -a fake_tide_left_prompt_items prompt_char
_display_prompt
set -e fake_tide_left_prompt_items[-1]
_option 2 'Left'
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled false
_display_prompt
_option 3 'Right'
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled true
set -a fake_tide_left_prompt_items prompt_char
_display_prompt
set -e fake_tide_left_prompt_items[-1]
_option 4 'Full'
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled true
_display_prompt
_display_restart_and_quit
switch (_menu 'Choice' 1/2/3/4/r/q)
case 1
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled false
set -a fake_tide_left_prompt_items prompt_char
_next_choice 'all/prompt_spacing'
case 2
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled false
_next_choice 'all/prompt_spacing'
case 3
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled true
set -a fake_tide_left_prompt_items prompt_char
_next_choice 'all/prompt_spacing'
case 4
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled true
_next_choice 'all/prompt_spacing'
case r
_begin
case q
_quit
end
end

View File

@ -0,0 +1,48 @@
function rainbow_prompt_heads
_title 'Prompt Heads'
_option 1 'Sharp'
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
_display_prompt
_option 2 'Blurred'
set -g fake_tide_left_prompt_suffix '▓▒░'
set -g fake_tide_right_prompt_prefix '░▒▓'
_display_prompt
_option 3 'Slanted'
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
_display_prompt
_option 4 'Round'
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
_display_prompt
_display_restart_and_quit
switch (_menu 'Choice' 1/2/3/4/r/q)
case 1
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
_next_choice 'rainbow/rainbow_prompt_tails'
case 2
set -g fake_tide_left_prompt_suffix '▓▒░'
set -g fake_tide_right_prompt_prefix '░▒▓'
_next_choice 'rainbow/rainbow_prompt_tails'
case 3
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
_next_choice 'rainbow/rainbow_prompt_tails'
case 4
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
_next_choice 'rainbow/rainbow_prompt_tails'
case r
_begin
case q
_quit
end
end

View File

@ -0,0 +1,35 @@
function rainbow_prompt_height
_title 'Prompt Height'
_option 1 'One line'
set -e fake_tide_left_prompt_items[(contains -i 'newline' $fake_tide_left_prompt_items)]
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled false
_display_prompt
_option 2 'Two lines'
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items 'newline'
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled true
_display_prompt
_display_restart_and_quit
switch (_menu 'Choice' 1/2/r/q)
case 1
set -e fake_tide_left_prompt_items[(contains -i 'newline' $fake_tide_left_prompt_items)]
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled false
_next_choice 'all/prompt_spacing'
case 2
set -e fake_tide_left_prompt_items[(contains -i 'newline' $fake_tide_left_prompt_items)]
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items 'newline'
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled true
_next_choice 'rainbow/rainbow_prompt_connection'
case r
_begin
case q
_quit
end
end

View File

@ -0,0 +1,48 @@
function rainbow_prompt_separators
_title 'Prompt Separators'
_option 1 'Angled'
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_display_prompt
_option 2 'Vertical'
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_display_prompt
_option 3 'Slanted'
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_display_prompt
_option 4 'Round'
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_display_prompt
_display_restart_and_quit
switch (_menu 'Choice' 1/2/3/4/r/q)
case 1
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_next_choice 'rainbow/rainbow_prompt_heads'
case 2
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_next_choice 'rainbow/rainbow_prompt_heads'
case 3
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_next_choice 'rainbow/rainbow_prompt_heads'
case 4
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_next_choice 'rainbow/rainbow_prompt_heads'
case r
_begin
case q
_quit
end
end

View File

@ -0,0 +1,57 @@
function rainbow_prompt_tails
_title 'Prompt Tails'
_option 1 'Flat'
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_display_prompt
_option 2 'Blurred'
set -g fake_tide_left_prompt_prefix '░▒▓'
set -g fake_tide_right_prompt_suffix '▓▒░'
_display_prompt
_option 3 'Sharp'
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_display_prompt
_option 4 'Slanted'
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_display_prompt
_option 5 'Round'
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_display_prompt
_display_restart_and_quit
switch (_menu 'Choice' 1/2/3/4/5/r/q)
case 1
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_next_choice 'rainbow/rainbow_prompt_height'
case 2
set -g fake_tide_left_prompt_prefix '░▒▓'
set -g fake_tide_right_prompt_suffix '▓▒░'
_next_choice 'rainbow/rainbow_prompt_height'
case 3
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_next_choice 'rainbow/rainbow_prompt_height'
case 4
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_next_choice 'rainbow/rainbow_prompt_height'
case 5
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_next_choice 'rainbow/rainbow_prompt_height'
case r
_begin
case q
_quit
end
end

View File

@ -0,0 +1,33 @@
function rainbow_show_time
_title 'Show current time?'
_option 1 'No'
_display_prompt
set -a fake_tide_right_prompt_items 'time'
_option 2 '24-hour format'
_display_prompt fake_tide_time_format '%T'
_option 3 '12-hour format'
_display_prompt fake_tide_time_format '%r'
_display_restart_and_quit
switch (_menu 'Choice' 1/2/3/r/q)
case 1
set -g fake_tide_time_format ''
set -e fake_tide_right_prompt_items[-1]
_next_choice 'rainbow/rainbow_prompt_separators'
case 2
set -g fake_tide_time_format '%T'
_next_choice 'rainbow/rainbow_prompt_separators'
case 3
set -g fake_tide_time_format '%r'
_next_choice 'rainbow/rainbow_prompt_separators'
case r
_begin
case q
_quit
end
end

View File

@ -73,9 +73,10 @@ _set fake___fish_git_prompt_color_stashstate $_tide_color_green
# --------------Status--------------
_set fake_tide_status_success_icon '✔'
_set fake_tide_status_success_color $tideColorDarkerGreen
_set fake_tide_status_success_bg_color 444444
_set fake_tide_status_failure_icon '✘'
_set fake_tide_status_failure_color D70000
_set fake_tide_status_bg_color 444444
_set fake_tide_status_failure_bg_color 444444
# -----------Cmd_Duration-----------
_set fake_tide_cmd_duration_color 87875F
_set fake_tide_cmd_duration_decimals 0

View File

@ -73,9 +73,10 @@ _set fake___fish_git_prompt_color_stashstate $_tide_color_green
# --------------Status--------------
_set fake_tide_status_success_icon '✔'
_set fake_tide_status_success_color $tideColorDarkerGreen
_set fake_tide_status_success_bg_color normal
_set fake_tide_status_failure_icon '✘'
_set fake_tide_status_failure_color D70000
_set fake_tide_status_bg_color normal
_set fake_tide_status_failure_bg_color normal
# -----------Cmd_Duration-----------
_set fake_tide_cmd_duration_color 87875F
_set fake_tide_cmd_duration_decimals 0

View File

@ -5,7 +5,7 @@ set -l tideColorDarkerGreen 5FAF00
# ---------------General Theme Variables---------------
_set fake_tide_print_newline_before_prompt 'true'
# ------------Left Prompt------------
_set fake_tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char' 'virtual_env'
_set fake_tide_left_prompt_items 'pwd' 'git_prompt' 'cmd_duration' 'virtual_env' 'newline' 'prompt_char'
_set fake_tide_left_prompt_pad_items false
_set fake_tide_left_prompt_item_separator_same_color ' '
@ -72,9 +72,10 @@ _set fake___fish_git_prompt_color_stashstate cyan
# --------------Status--------------
_set fake_tide_status_success_icon '✔'
_set fake_tide_status_success_color $tideColorDarkerGreen
_set fake_tide_status_success_bg_color normal
_set fake_tide_status_failure_icon '✘'
_set fake_tide_status_failure_color D70000
_set fake_tide_status_bg_color normal
_set fake_tide_status_failure_bg_color normal
# -----------Cmd_Duration-----------
_set fake_tide_cmd_duration_color yellow
_set fake_tide_cmd_duration_decimals 0

View File

@ -0,0 +1,101 @@
# -------------------Local Variables-------------------
set -l tideColorGold D7AF00
set -l tideColorDarkerGreen 5FAF00
# ---------------General Theme Variables---------------
_set fake_tide_print_newline_before_prompt 'true'
# ------------Left Prompt------------
_set fake_tide_left_prompt_items 'pwd' 'git_prompt' 'newline'
_set fake_tide_left_prompt_pad_items true
_set fake_tide_left_prompt_item_separator_same_color ''
_set fake_tide_left_prompt_item_separator_diff_color ''
_set fake_tide_left_prompt_item_separator_same_color_color 949494
_set fake_tide_right_prompt_item_separator_same_color_color 949494
_set fake_tide_left_prompt_prefix ''
_set fake_tide_left_prompt_suffix ''
_set fake_tide_left_prompt_frame_enabled true
_set fake_tide_left_prompt_frame_color 6C6C6C
# ------------Right Prompt------------
_set fake_tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'virtual_env'
_set fake_tide_right_prompt_pad_items true
_set fake_tide_right_prompt_item_separator_same_color ''
_set fake_tide_right_prompt_item_separator_diff_color ''
_set fake_tide_right_prompt_prefix ''
_set fake_tide_right_prompt_suffix ''
_set fake_tide_right_prompt_frame_enabled true
_set fake_tide_right_prompt_frame_color 6C6C6C
# ---------Prompt Connection---------
_set fake_tide_prompt_connection_color 6C6C6C
_set fake_tide_prompt_connection_icon ' '
# --------------------Prompt Items--------------------
# ------------Prompt Char------------
_set fake_tide_prompt_char_success_color $_tide_color_green
_set fake_tide_prompt_char_failure_color FF0000
_set fake_tide_prompt_char_icon ''
_set fake_tide_prompt_char_bg_color normal
# ----------------Pwd----------------
_set fake_tide_pwd_truncate_margin 10
_set fake_tide_pwd_unwritable_icon '' # Lock
_set fake_tide_pwd_max_dirs 0
_set fake_tide_pwd_anchors 'first' 'last' 'git'
_set fake_tide_pwd_color_anchors E4E4E4
_set fake_tide_pwd_color_dirs E4E4E4
_set fake_tide_pwd_color_truncated_dirs BCBCBC
_set fake_tide_pwd_bg_color blue
# ------------Git prompt------------
_set fake___fish_git_prompt_show_informative_status true
_set fake___fish_git_prompt_showstashstate true
_set fake_tide_git_prompt_bg_color 4E9A06
# -------Symbols-------
_set fake___fish_git_prompt_char_stateseparator ''
_set fake___fish_git_prompt_char_cleanstate ''
_set fake___fish_git_prompt_char_upstream_ahead ' ⇡'
_set fake___fish_git_prompt_char_upstream_behind ' ⇣'
_set fake___fish_git_prompt_char_stagedstate ' +'
_set fake___fish_git_prompt_char_dirtystate ' !'
_set fake___fish_git_prompt_char_untrackedfiles ' ?'
_set fake___fish_git_prompt_char_stashstate ' *'
# --------Colors--------
_set fake___fish_git_prompt_color_branch 000000
_set fake___fish_git_prompt_color_upstream 000000
_set fake___fish_git_prompt_color_stagedstate 000000
_set fake___fish_git_prompt_color_dirtystate 000000
_set fake___fish_git_prompt_color_untrackedfiles 000000
_set fake___fish_git_prompt_color_stashstate 000000
# --------------Status--------------
_set fake_tide_status_success_icon '✔'
_set fake_tide_status_success_color 4E9A06
_set fake_tide_status_success_bg_color 000000
_set fake_tide_status_failure_icon '✘'
_set fake_tide_status_failure_color FFFF00
_set fake_tide_status_failure_bg_color CC0000
# -----------Cmd_Duration-----------
_set fake_tide_cmd_duration_color 000000
_set fake_tide_cmd_duration_decimals 0
_set fake_tide_cmd_duration_threshold 3000
_set fake_tide_cmd_duration_bg_color C4A000
# --------------Context--------------
_set fake_tide_context_ssh_color D7AF87
_set fake_tide_context_root_color $tideColorGold
_set fake_tide_context_bg_color 444444
# ---------------Jobs---------------
_set fake_tide_jobs_icon '' # Gear
_set fake_tide_jobs_color 4E9A06
_set fake_tide_jobs_bg_color 444444
# ---------------Virtual_Env---------------
_set fake_tide_virtual_env_color 00AFAF
_set fake_tide_virtual_env_display 'projectName'
_set fake_tide_virtual_env_icon ''
_set fake_tide_virtual_env_bg_color 444444
# ---------------Time---------------
_set fake_tide_time_color 000000
_set fake_tide_time_format '%T'
_set fake_tide_time_bg_color D3D7CF

View File

@ -5,8 +5,8 @@ function tide_configure
end
set -g fake_columns $COLUMNS
if test $fake_columns -gt 100
set -g fake_columns 100
if test $fake_columns -gt 90
set -g fake_columns 90
end
set -g fake_lines $LINES