From aafed7cb24232121afef286f052b0d23e212bfae Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Wed, 6 Nov 2019 09:41:03 -0800 Subject: [PATCH] Add nix prompt, glyph, and colors --- fish_prompt.fish | 10 ++++++++++ functions/__bobthefish_colors.fish | 15 +++++++++++++++ functions/__bobthefish_glyphs.fish | 2 ++ 3 files changed, 27 insertions(+) diff --git a/fish_prompt.fish b/fish_prompt.fish index 0a6a3f3..dd209a0 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -859,6 +859,15 @@ function __bobthefish_prompt_nvm -S -d 'Display current node version through NVM set_color normal end +function __bobthefish_prompt_nix -S -d 'Display current nix environment' + [ "$theme_display_nix" = 'no' -o -z "$IN_NIX_SHELL" ] + and return + + __bobthefish_start_segment $color_nix + echo -ns $nix_glyph $IN_NIX_SHELL ' ' + + set_color normal +end # ============================== # VCS segments @@ -1057,6 +1066,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' __bobthefish_prompt_k8s_context # Virtual environments + __bobthefish_prompt_nix __bobthefish_prompt_desk __bobthefish_prompt_rubies __bobthefish_prompt_virtualfish diff --git a/functions/__bobthefish_colors.fish b/functions/__bobthefish_colors.fish index 8b25309..93be762 100644 --- a/functions/__bobthefish_colors.fish +++ b/functions/__bobthefish_colors.fish @@ -34,6 +34,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish brblue $colorfg --bold set -x color_virtualgo brblue $colorfg --bold set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold case 'terminal-light*' set -l colorfg white @@ -65,6 +66,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish brblue $colorfg --bold set -x color_virtualgo brblue $colorfg --bold set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold case 'terminal2' 'terminal2-dark*' set -l colorfg black @@ -96,6 +98,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish brblue $colorfg --bold set -x color_virtualgo brblue $colorfg --bold set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold case 'terminal2-light*' set -l colorfg white @@ -127,6 +130,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish brblue $colorfg --bold set -x color_virtualgo brblue $colorfg --bold set -x color_desk brblue $colorfg --bold + set -x color_nix brblue $colorfg --bold case 'zenburn' set -l grey 333333 # a bit darker than normal zenburn grey @@ -164,6 +168,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish $blue $grey --bold set -x color_virtualgo $blue $grey --bold set -x color_desk $blue $grey --bold + set -x color_nix $blue $grey --bold case 'base16-light' set -l base00 181818 @@ -212,6 +217,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish $base0D $colorfg --bold set -x color_virtualgo $base0D $colorfg --bold set -x color_desk $base0D $colorfg --bold + set -x color_nix $base0D $colorfg --bold case 'base16' 'base16-dark' set -l base00 181818 @@ -260,6 +266,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish $base0D $colorfg --bold set -x color_virtualgo $base0D $colorfg --bold set -x color_desk $base0D $colorfg --bold + set -x color_nix $base0D $colorfg --bold case 'solarized-light' set -l base03 002b36 @@ -308,6 +315,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish $cyan $colorfg --bold set -x color_virtualgo $cyan $colorfg --bold set -x color_desk $cyan $colorfg --bold + set -x color_nix $cyan $colorfg --bold case 'solarized' 'solarized-dark' set -l base03 002b36 @@ -356,6 +364,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish $cyan $colorfg --bold set -x color_virtualgo $cyan $colorfg --bold set -x color_desk $cyan $colorfg --bold + set -x color_nix $cyan $colorfg --bold case 'light' # light medium dark @@ -397,6 +406,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish $blue[2] $grey[1] --bold set -x color_virtualgo $blue[2] $grey[1] --bold set -x color_desk $blue[2] $grey[1] --bold + set -x color_nix $blue[2] $grey[1] --bold case 'gruvbox' # light medium dark darkest @@ -437,6 +447,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe 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 @@ -479,6 +490,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe 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 @@ -569,6 +581,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe set -x color_virtualfish $blue[2] $grey[1] --bold set -x color_virtualgo $go_blue $black --bold set -x color_desk $blue[2] $grey[1] --bold + set -x color_nix $blue[2] $grey[1] --bold end end @@ -594,6 +607,7 @@ function __bobthefish_user_color_scheme_deprecated 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." @@ -630,6 +644,7 @@ function __bobthefish_user_color_scheme_deprecated 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 diff --git a/functions/__bobthefish_glyphs.fish b/functions/__bobthefish_glyphs.fish index 6d82b66..6513368 100644 --- a/functions/__bobthefish_glyphs.fish +++ b/functions/__bobthefish_glyphs.fish @@ -21,6 +21,7 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish' set -x ruby_glyph '' set -x go_glyph '' + set -x nix_glyph '' # Desk glyphs set -x desk_glyph \u25F2 @@ -62,6 +63,7 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish' set detached_glyph \uF417 set tag_glyph \uF412 + set nix_glyph \uF313 ' ' # nf-linux-nixos set virtualenv_glyph \uE73C ' ' set ruby_glyph \uE791 ' ' set go_glyph \uE626 ' '