Add a $fish_private_mode indicator.

Fixes #263
pull/267/head
Justin Hileman 4 years ago
parent a2ad38aa05
commit bd9d0e0f31

@ -411,7 +411,7 @@ end
# Status segment
# ==============================
function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a non-zero exit status, root user, and background jobs'
function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a non-zero exit status, private mode, root user, and background jobs'
set -l nonzero
set -l superuser
set -l bg_jobs
@ -451,7 +451,7 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a no
end
end
if [ "$nonzero" -o "$superuser" -o "$bg_jobs" ]
if [ "$nonzero" -o "$fish_private_mode" -o "$superuser" -o "$bg_jobs" ]
__bobthefish_start_segment $color_initial_segment_exit
if [ "$nonzero" ]
set_color normal
@ -463,6 +463,12 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a no
end
end
if [ "$fish_private_mode" ]
set_color normal
set_color -b $color_initial_segment_private
echo -n $private_glyph
end
if [ "$superuser" ]
set_color normal
if [ -z "$FAKEROOTKEY" ]

@ -8,6 +8,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg black
[ "$color_scheme" = 'terminal-dark-white' ]; and set colorfg white
set -x color_initial_segment_exit white red --bold
set -x color_initial_segment_private white black
set -x color_initial_segment_su white green --bold
set -x color_initial_segment_jobs white blue --bold
@ -40,6 +41,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg white
[ "$color_scheme" = 'terminal-light-black' ]; and set colorfg black
set -x color_initial_segment_exit black red --bold
set -x color_initial_segment_private black white
set -x color_initial_segment_su black green --bold
set -x color_initial_segment_jobs black blue --bold
@ -72,6 +74,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg black
[ "$color_scheme" = 'terminal2-dark-white' ]; and set colorfg white
set -x color_initial_segment_exit grey red --bold
set -x color_initial_segment_private grey black
set -x color_initial_segment_su grey green --bold
set -x color_initial_segment_jobs grey blue --bold
@ -104,6 +107,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg white
[ "$color_scheme" = 'terminal2-light-black' ]; and set colorfg black
set -x color_initial_segment_exit brgrey red --bold
set -x color_initial_segment_private brgrey black
set -x color_initial_segment_su brgrey green --bold
set -x color_initial_segment_jobs brgrey blue --bold
@ -142,6 +146,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l white DCDCCC
set -x color_initial_segment_exit $white $red --bold
set -x color_initial_segment_private $white $grey
set -x color_initial_segment_su $white $green --bold
set -x color_initial_segment_jobs $white $blue --bold
@ -191,6 +196,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg $base00
set -x color_initial_segment_exit $base02 $base08 --bold
set -x color_initial_segment_private $base02 $base06
set -x color_initial_segment_su $base02 $base0B --bold
set -x color_initial_segment_jobs $base02 $base0D --bold
@ -240,6 +246,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg $base07
set -x color_initial_segment_exit $base05 $base08 --bold
set -x color_initial_segment_private $base05 $base02
set -x color_initial_segment_su $base05 $base0B --bold
set -x color_initial_segment_jobs $base05 $base0D --bold
@ -289,6 +296,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set colorfg $base03
set -x color_initial_segment_exit $base02 $red --bold
set -x color_initial_segment_private $base02 $base2
set -x color_initial_segment_su $base02 $green --bold
set -x color_initial_segment_jobs $base02 $blue --bold
@ -338,6 +346,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set colorfg $base3
set -x color_initial_segment_exit $base2 $red --bold
set -x color_initial_segment_private $base2 $base02
set -x color_initial_segment_su $base2 $green --bold
set -x color_initial_segment_jobs $base2 $blue --bold
@ -380,6 +389,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l ruby_red af0000
set -x color_initial_segment_exit $grey[3] $red[2] --bold
set -x color_initial_segment_private $grey[3] $grey[1]
set -x color_initial_segment_su $grey[3] $green[2] --bold
set -x color_initial_segment_jobs $grey[3] $blue[3] --bold
@ -420,34 +430,35 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l fg fbf1c7 ebdbb2 d5c4a1 a89984
set -l bg 504945 282828
set -x color_initial_segment_exit $fg[1] $red[2] --bold
set -x color_initial_segment_su $fg[1] $green[2] --bold
set -x color_initial_segment_jobs $fg[1] $aqua[2] --bold
set -x color_path $bg[1] $fg[2]
set -x color_path_basename $bg[1] $fg[2] --bold
set -x color_path_nowrite $red[1] $fg[2]
set -x color_path_nowrite_basename $red[1] $fg[2] --bold
set -x color_repo $green[2] $bg[1]
set -x color_repo_work_tree $bg[1] $fg[2] --bold
set -x color_repo_dirty $red[2] $fg[2]
set -x color_repo_staged $yellow[1] $bg[1]
set -x color_vi_mode_default $fg[4] $bg[2] --bold
set -x color_vi_mode_insert $blue[1] $bg[2] --bold
set -x color_vi_mode_visual $yellow[1] $bg[2] --bold
set -x color_vagrant $blue[2] $fg[2] --bold
set -x color_k8s $green[2] $fg[2] --bold
set -x color_username $fg[3] $blue[2] --bold
set -x color_hostname $fg[3] $blue[2]
set -x color_rvm $red[2] $fg[2] --bold
set -x color_nvm $green[1] $fg[2] --bold
set -x color_virtualfish $blue[2] $fg[2] --bold
set -x color_virtualgo $blue[2] $fg[2] --bold
set -x color_desk $blue[2] $fg[2] --bold
set -x color_nix $blue[2] $fg[2] --bold
set -x color_initial_segment_exit $fg[1] $red[2] --bold
set -x color_initial_segment_private $fg[1] $bg[1]
set -x color_initial_segment_su $fg[1] $green[2] --bold
set -x color_initial_segment_jobs $fg[1] $aqua[2] --bold
set -x color_path $bg[1] $fg[2]
set -x color_path_basename $bg[1] $fg[2] --bold
set -x color_path_nowrite $red[1] $fg[2]
set -x color_path_nowrite_basename $red[1] $fg[2] --bold
set -x color_repo $green[2] $bg[1]
set -x color_repo_work_tree $bg[1] $fg[2] --bold
set -x color_repo_dirty $red[2] $fg[2]
set -x color_repo_staged $yellow[1] $bg[1]
set -x color_vi_mode_default $fg[4] $bg[2] --bold
set -x color_vi_mode_insert $blue[1] $bg[2] --bold
set -x color_vi_mode_visual $yellow[1] $bg[2] --bold
set -x color_vagrant $blue[2] $fg[2] --bold
set -x color_k8s $green[2] $fg[2] --bold
set -x color_username $fg[3] $blue[2] --bold
set -x color_hostname $fg[3] $blue[2]
set -x color_rvm $red[2] $fg[2] --bold
set -x color_nvm $green[1] $fg[2] --bold
set -x color_virtualfish $blue[2] $fg[2] --bold
set -x color_virtualgo $blue[2] $fg[2] --bold
set -x color_desk $blue[2] $fg[2] --bold
set -x color_nix $blue[2] $fg[2] --bold
case 'dracula' # https://draculatheme.com
set -l bg 282a36
@ -463,34 +474,35 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l red ff5555
set -l yellow f1fa8c
set -x color_initial_segment_exit $fg $red --bold
set -x color_initial_segment_su $fg $purple --bold
set -x color_initial_segment_jobs $fg $comment --bold
set -x color_path $selection $fg
set -x color_path_basename $selection $fg --bold
set -x color_path_nowrite $selection $red
set -x color_path_nowrite_basename $selection $red --bold
set -x color_repo $green $bg
set -x color_repo_work_tree $selection $fg --bold
set -x color_repo_dirty $red $bg
set -x color_repo_staged $yellow $bg
set -x color_vi_mode_default $bg $yellow --bold
set -x color_vi_mode_insert $green $bg --bold
set -x color_vi_mode_visual $orange $bg --bold
set -x color_vagrant $pink $bg --bold
set -x color_k8s $green $fg --bold
set -x color_username $selection $cyan --bold
set -x color_hostname $selection $cyan
set -x color_rvm $red $bg --bold
set -x color_nvm $green $bg --bold
set -x color_virtualfish $comment $bg --bold
set -x color_virtualgo $cyan $bg --bold
set -x color_desk $comment $bg --bold
set -x color_nix $cyan $bg --bold
set -x color_initial_segment_exit $fg $red --bold
set -x color_initial_segment_private $fg $selection
set -x color_initial_segment_su $fg $purple --bold
set -x color_initial_segment_jobs $fg $comment --bold
set -x color_path $selection $fg
set -x color_path_basename $selection $fg --bold
set -x color_path_nowrite $selection $red
set -x color_path_nowrite_basename $selection $red --bold
set -x color_repo $green $bg
set -x color_repo_work_tree $selection $fg --bold
set -x color_repo_dirty $red $bg
set -x color_repo_staged $yellow $bg
set -x color_vi_mode_default $bg $yellow --bold
set -x color_vi_mode_insert $green $bg --bold
set -x color_vi_mode_visual $orange $bg --bold
set -x color_vagrant $pink $bg --bold
set -x color_k8s $green $fg --bold
set -x color_username $selection $cyan --bold
set -x color_hostname $selection $cyan
set -x color_rvm $red $bg --bold
set -x color_nvm $green $bg --bold
set -x color_virtualfish $comment $bg --bold
set -x color_virtualgo $cyan $bg --bold
set -x color_desk $comment $bg --bold
set -x color_nix $cyan $bg --bold
case 'nord'
set -l base00 2E3440
@ -513,6 +525,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg $base00
set -x color_initial_segment_exit $base05 $base08 --bold
set -x color_initial_segment_private $base05 $base02
set -x color_initial_segment_su $base05 $base0B --bold
set -x color_initial_segment_jobs $base08 $base0D --bold
@ -555,6 +568,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l go_blue 00d7d7
set -x color_initial_segment_exit $white $red[2] --bold
set -x color_initial_segment_private $white $grey[3]
set -x color_initial_segment_su $white $green[2] --bold
set -x color_initial_segment_jobs $white $blue[3] --bold
@ -586,28 +600,29 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
end
function __bobthefish_user_color_scheme_deprecated
set -q __color_initial_segment_exit; or set -l __color_initial_segment_exit ffffff ce000f --bold
set -q __color_initial_segment_su; or set -l __color_initial_segment_su ffffff 189303 --bold
set -q __color_initial_segment_jobs; or set -l __color_initial_segment_jobs ffffff 255e87 --bold
set -q __color_path; or set -l __color_path 333333 999999
set -q __color_path_basename; or set -l __color_path_basename 333333 ffffff --bold
set -q __color_path_nowrite; or set -l __color_path_nowrite 660000 cc9999
set -q __color_path_nowrite_basename; or set -l __color_path_nowrite_basename 660000 cc9999 --bold
set -q __color_repo; or set -l __color_repo addc10 0c4801
set -q __color_repo_work_tree; or set -l __color_repo_work_tree 333333 ffffff --bold
set -q __color_repo_dirty; or set -l __color_repo_dirty ce000f ffffff
set -q __color_repo_staged; or set -l __color_repo_staged f6b117 3a2a03
set -q __color_vi_mode_default; or set -l __color_vi_mode_default 999999 333333 --bold
set -q __color_vi_mode_insert; or set -l __color_vi_mode_insert 189303 333333 --bold
set -q __color_vi_mode_visual; or set -l __color_vi_mode_visual f6b117 3a2a03 --bold
set -q __color_vagrant; or set -l __color_vagrant 48b4fb ffffff --bold
set -q __color_username; or set -l __color_username cccccc 255e87 --bold
set -q __color_hostname; or set -l __color_hostname cccccc 255e87
set -q __color_rvm; or set -l __color_rvm af0000 cccccc --bold
set -q __color_virtualfish; or set -l __color_virtualfish 005faf cccccc --bold
set -q __color_virtualgo; or set -l __color_virtualgo 005faf cccccc --bold
set -q __color_desk; or set -l __color_desk 005faf cccccc --bold
set -q __color_nix; or set -l __color_nix 005faf cccccc --bold
set -q __color_initial_segment_exit; or set -l __color_initial_segment_exit ffffff ce000f --bold
set -q __color_initial_segment_private; or set -l __color_initial_segment_private ffffff 255e87
set -q __color_initial_segment_su; or set -l __color_initial_segment_su ffffff 189303 --bold
set -q __color_initial_segment_jobs; or set -l __color_initial_segment_jobs ffffff 255e87 --bold
set -q __color_path; or set -l __color_path 333333 999999
set -q __color_path_basename; or set -l __color_path_basename 333333 ffffff --bold
set -q __color_path_nowrite; or set -l __color_path_nowrite 660000 cc9999
set -q __color_path_nowrite_basename; or set -l __color_path_nowrite_basename 660000 cc9999 --bold
set -q __color_repo; or set -l __color_repo addc10 0c4801
set -q __color_repo_work_tree; or set -l __color_repo_work_tree 333333 ffffff --bold
set -q __color_repo_dirty; or set -l __color_repo_dirty ce000f ffffff
set -q __color_repo_staged; or set -l __color_repo_staged f6b117 3a2a03
set -q __color_vi_mode_default; or set -l __color_vi_mode_default 999999 333333 --bold
set -q __color_vi_mode_insert; or set -l __color_vi_mode_insert 189303 333333 --bold
set -q __color_vi_mode_visual; or set -l __color_vi_mode_visual f6b117 3a2a03 --bold
set -q __color_vagrant; or set -l __color_vagrant 48b4fb ffffff --bold
set -q __color_username; or set -l __color_username cccccc 255e87 --bold
set -q __color_hostname; or set -l __color_hostname cccccc 255e87
set -q __color_rvm; or set -l __color_rvm af0000 cccccc --bold
set -q __color_virtualfish; or set -l __color_virtualfish 005faf cccccc --bold
set -q __color_virtualgo; or set -l __color_virtualgo 005faf cccccc --bold
set -q __color_desk; or set -l __color_desk 005faf cccccc --bold
set -q __color_nix; or set -l __color_nix 005faf cccccc --bold
set_color black -b red --bold
echo "The 'user' color scheme is deprecated."
@ -623,28 +638,29 @@ function __bobthefish_user_color_scheme_deprecated
___bobthefish_colors default
# then override everything you want! note that these must be defined with `set -x`
set -x color_initial_segment_exit $__color_initial_segment_exit
set -x color_initial_segment_su $__color_initial_segment_su
set -x color_initial_segment_jobs $__color_initial_segment_jobs
set -x color_path $__color_path
set -x color_path_basename $__color_path_basename
set -x color_path_nowrite $__color_path_nowrite
set -x color_path_nowrite_basename $__color_path_nowrite_basename
set -x color_repo $__color_repo
set -x color_repo_work_tree $__color_repo_work_tree
set -x color_repo_dirty $__color_repo_dirty
set -x color_repo_staged $__color_repo_staged
set -x color_vi_mode_default $__color_vi_mode_default
set -x color_vi_mode_insert $__color_vi_mode_insert
set -x color_vi_mode_visual $__color_vi_mode_visual
set -x color_vagrant $__color_vagrant
set -x color_username $__color_username
set -x color_hostname $__color_hostname
set -x color_rvm $__color_rvm
set -x color_virtualfish $__color_virtualfish
set -x color_virtualgo $__color_virtualgo
set -x color_desk $__color_desk
set -x color_nix $__color_nix
set -x color_initial_segment_exit $__color_initial_segment_exit
set -x color_initial_segment_private $__color_initial_segment_private
set -x color_initial_segment_su $__color_initial_segment_su
set -x color_initial_segment_jobs $__color_initial_segment_jobs
set -x color_path $__color_path
set -x color_path_basename $__color_path_basename
set -x color_path_nowrite $__color_path_nowrite
set -x color_path_nowrite_basename $__color_path_nowrite_basename
set -x color_repo $__color_repo
set -x color_repo_work_tree $__color_repo_work_tree
set -x color_repo_dirty $__color_repo_dirty
set -x color_repo_staged $__color_repo_staged
set -x color_vi_mode_default $__color_vi_mode_default
set -x color_vi_mode_insert $__color_vi_mode_insert
set -x color_vi_mode_visual $__color_vi_mode_visual
set -x color_vagrant $__color_vagrant
set -x color_username $__color_username
set -x color_hostname $__color_hostname
set -x color_rvm $__color_rvm
set -x color_virtualfish $__color_virtualfish
set -x color_virtualgo $__color_virtualgo
set -x color_desk $__color_desk
set -x color_nix $__color_nix
end"
echo

@ -10,6 +10,7 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
set -x detached_glyph \u27A6
set -x tag_glyph \u2302
set -x nonzero_exit_glyph '! '
set -x private_glyph \uE0A2 ' '
set -x superuser_glyph '$ '
set -x bg_job_glyph '% '
set -x hg_glyph \u263F
@ -50,6 +51,7 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
# Disable Powerline fonts (unless we're using nerd fonts instead)
if [ "$theme_powerline_fonts" = "no" -a "$theme_nerd_fonts" != "yes" ]
set private_glyph \u29B8 ' '
set branch_glyph \u2387
set right_black_arrow_glyph ''
set right_arrow_glyph ''
@ -59,6 +61,8 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
# Use prettier Nerd Fonts glyphs
if [ "$theme_nerd_fonts" = "yes" ]
set private_glyph \uF023 ' ' # nf-fa-lock
set branch_glyph \uF418
set detached_glyph \uF417
set tag_glyph \uF412

@ -49,6 +49,8 @@ function bobthefish_display_colors -a color_scheme -d 'Print example prompt colo
__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

Loading…
Cancel
Save