From b3ef5962292f955dff670a52f5273dcbda5ffd3a Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Sun, 3 Oct 2021 12:05:43 -0700 Subject: [PATCH] Add private mode item (closes #157) --- functions/_tide_cache_variables.fish | 7 +++++++ functions/_tide_item_private_mode.fish | 3 +++ functions/tide/configure/configs/classic.fish | 3 +++ functions/tide/configure/configs/classic_16color.fish | 2 ++ functions/tide/configure/configs/lean.fish | 3 +++ functions/tide/configure/configs/lean_16color.fish | 2 ++ functions/tide/configure/configs/rainbow.fish | 3 +++ functions/tide/configure/configs/rainbow_16color.fish | 2 ++ 8 files changed, 25 insertions(+) create mode 100644 functions/_tide_item_private_mode.fish diff --git a/functions/_tide_cache_variables.fish b/functions/_tide_cache_variables.fish index 2478d5a..4886a75 100644 --- a/functions/_tide_cache_variables.fish +++ b/functions/_tide_cache_variables.fish @@ -8,6 +8,13 @@ function _tide_cache_variables contains git $tide_left_prompt_items $tide_right_prompt_items && set -gx _tide_location_color "$(set_color $tide_git_color_branch)" + # private_mode + if contains private_mode $tide_left_prompt_items $tide_right_prompt_items && test -n "$fish_private_mode" + set -gx _tide_private_mode + else + set -e _tide_private_mode + end + # two line prompt if contains newline $tide_left_prompt_items set_color $tide_prompt_color_frame_and_connection -b normal | read -gx _tide_prompt_and_frame_color diff --git a/functions/_tide_item_private_mode.fish b/functions/_tide_item_private_mode.fish new file mode 100644 index 0000000..4eb4684 --- /dev/null +++ b/functions/_tide_item_private_mode.fish @@ -0,0 +1,3 @@ +function _tide_item_private_mode + set -q _tide_private_mode && _tide_print_item private_mode $tide_private_mode_icon +end diff --git a/functions/tide/configure/configs/classic.fish b/functions/tide/configure/configs/classic.fish index fcbe1c4..2b1efc5 100644 --- a/functions/tide/configure/configs/classic.fish +++ b/functions/tide/configure/configs/classic.fish @@ -52,6 +52,9 @@ tide_os_color EEEEEE tide_php_bg_color 444444 tide_php_color 617CBE tide_php_icon '' +tide_private_mode_bg_color 444444 +tide_private_mode_color FFFFFF +tide_private_mode_icon 﫸 tide_prompt_add_newline_before true tide_prompt_color_frame_and_connection 6C6C6C tide_prompt_color_separator_same_color 949494 diff --git a/functions/tide/configure/configs/classic_16color.fish b/functions/tide/configure/configs/classic_16color.fish index d3a505f..34fb0bc 100644 --- a/functions/tide/configure/configs/classic_16color.fish +++ b/functions/tide/configure/configs/classic_16color.fish @@ -31,6 +31,8 @@ tide_os_bg_color black tide_os_color brwhite tide_php_bg_color black tide_php_color blue +tide_private_mode_bg_color black +tide_private_mode_color brwhite tide_prompt_color_frame_and_connection brblack tide_prompt_color_separator_same_color brblack tide_pwd_bg_color black diff --git a/functions/tide/configure/configs/lean.fish b/functions/tide/configure/configs/lean.fish index ba45973..052c4d3 100644 --- a/functions/tide/configure/configs/lean.fish +++ b/functions/tide/configure/configs/lean.fish @@ -52,6 +52,9 @@ tide_os_color normal tide_php_bg_color normal tide_php_color 617CBE tide_php_icon '' +tide_private_mode_bg_color normal +tide_private_mode_color FFFFFF +tide_private_mode_icon 﫸 tide_prompt_add_newline_before true tide_prompt_color_frame_and_connection 6C6C6C tide_prompt_color_separator_same_color 949494 diff --git a/functions/tide/configure/configs/lean_16color.fish b/functions/tide/configure/configs/lean_16color.fish index ead6e6f..a1c1407 100644 --- a/functions/tide/configure/configs/lean_16color.fish +++ b/functions/tide/configure/configs/lean_16color.fish @@ -31,6 +31,8 @@ tide_os_bg_color normal tide_os_color brwhite tide_php_bg_color normal tide_php_color blue +tide_private_mode_bg_color normal +tide_private_mode_color brwhite tide_prompt_color_frame_and_connection brblack tide_prompt_color_separator_same_color brblack tide_pwd_bg_color normal diff --git a/functions/tide/configure/configs/rainbow.fish b/functions/tide/configure/configs/rainbow.fish index 39afcbc..24aaf3d 100644 --- a/functions/tide/configure/configs/rainbow.fish +++ b/functions/tide/configure/configs/rainbow.fish @@ -52,6 +52,9 @@ tide_os_color 080808 tide_php_bg_color 617CBE tide_php_color 000000 tide_php_icon '' +tide_private_mode_bg_color F1F3F4 +tide_private_mode_color 000000 +tide_private_mode_icon 﫸 tide_prompt_add_newline_before true tide_prompt_color_frame_and_connection 6C6C6C tide_prompt_color_separator_same_color 949494 diff --git a/functions/tide/configure/configs/rainbow_16color.fish b/functions/tide/configure/configs/rainbow_16color.fish index c38b6c5..61588c7 100644 --- a/functions/tide/configure/configs/rainbow_16color.fish +++ b/functions/tide/configure/configs/rainbow_16color.fish @@ -31,6 +31,8 @@ tide_os_bg_color white tide_os_color black tide_php_bg_color blue tide_php_color black +tide_private_mode_bg_color brwhite +tide_private_mode_color black tide_prompt_color_frame_and_connection brblack tide_prompt_color_separator_same_color brblack tide_pwd_bg_color blue