Skip to content

Commit

Permalink
Add Guix prompt.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeiyu committed Nov 9, 2021
1 parent 332f23a commit f74cf8a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ set -g theme_display_docker_machine no
set -g theme_display_k8s_context yes
set -g theme_display_hg yes
set -g theme_display_virtualenv no
set -g theme_display_guix no
set -g theme_display_nix no
set -g theme_display_ruby no
set -g theme_display_node yes
Expand Down
15 changes: 15 additions & 0 deletions functions/__bobthefish_colors.fish
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,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_guix brblue $colorfg --bold
set -x color_nix brblue $colorfg --bold

case 'terminal-light*'
Expand Down Expand Up @@ -72,6 +73,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_guix brblue $colorfg --bold
set -x color_nix brblue $colorfg --bold

case 'terminal2' 'terminal2-dark*'
Expand Down Expand Up @@ -107,6 +109,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_guix brblue $colorfg --bold
set -x color_nix brblue $colorfg --bold

case 'terminal2-light*'
Expand Down Expand Up @@ -142,6 +145,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_guix brblue $colorfg --bold
set -x color_nix brblue $colorfg --bold

case 'zenburn'
Expand Down Expand Up @@ -183,6 +187,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_guix $blue $grey --bold
set -x color_nix $blue $grey --bold

case 'base16-light'
Expand Down Expand Up @@ -235,6 +240,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_guix $base0D $colorfg --bold
set -x color_nix $base0D $colorfg --bold

case 'base16' 'base16-dark'
Expand Down Expand Up @@ -287,6 +293,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_guix $base0D $colorfg --bold
set -x color_nix $base0D $colorfg --bold

case 'solarized-light'
Expand Down Expand Up @@ -339,6 +346,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_guix $cyan $colorfg --bold
set -x color_nix $cyan $colorfg --bold

case 'solarized' 'solarized-dark'
Expand Down Expand Up @@ -391,6 +399,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_guix $cyan $colorfg --bold
set -x color_nix $cyan $colorfg --bold

case 'light'
Expand Down Expand Up @@ -436,6 +445,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_guix $blue[2] $grey[1] --bold
set -x color_nix $blue[2] $grey[1] --bold

case 'gruvbox'
Expand Down Expand Up @@ -480,6 +490,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_guix $blue[2] $fg[2] --bold
set -x color_nix $blue[2] $fg[2] --bold

case 'dracula' # https://draculatheme.com
Expand Down Expand Up @@ -526,6 +537,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_guix $cyan $bg --bold
set -x color_nix $cyan $bg --bold

case 'nord'
Expand Down Expand Up @@ -623,6 +635,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_guix $blue[2] $grey[1] --bold
set -x color_nix $blue[2] $grey[1] --bold
end
end
Expand Down Expand Up @@ -650,6 +663,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_guix; or set -l __color_guix 005faf cccccc --bold
set -q __color_nix; or set -l __color_nix 005faf cccccc --bold

set_color black -b red --bold
Expand Down Expand Up @@ -690,6 +704,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_guix $__color_guix
set -x color_nix $__color_nix
end"

Expand Down
1 change: 1 addition & 0 deletions functions/__bobthefish_glyphs.fish
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'

set -x ruby_glyph ''
set -x go_glyph ''
set -x guix_glyph ''
set -x nix_glyph ''

# Desk glyphs
Expand Down
4 changes: 4 additions & 0 deletions functions/bobthefish_display_colors.fish
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ function bobthefish_display_colors -a color_scheme -d 'Print example prompt colo
echo -ns $desk_glyph desk ' '
__bobthefish_finish_segments

__bobthefish_start_segment $color_guix
echo -ns $guix_glyph 'guix '
__bobthefish_finish_segments

__bobthefish_start_segment $color_aws_vault
echo -ns aws-vault ' (' active ') '
__bobthefish_finish_segments
Expand Down
12 changes: 12 additions & 0 deletions functions/fish_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
# set -g theme_display_aws_vault_profile yes
# set -g theme_display_hg yes
# set -g theme_display_virtualenv no
# set -g theme_display_guix no
# set -g theme_display_nix no
# set -g theme_display_ruby no
# set -g theme_display_user ssh
Expand Down Expand Up @@ -926,6 +927,16 @@ function __bobthefish_prompt_node -S -d 'Display current node version'
set_color normal
end

function __bobthefish_prompt_guix -S -d 'Display current Guix environment'
[ "$theme_display_guix" = 'no' -o -z "$GUIX_ENVIRONMENT" ]
and return

__bobthefish_start_segment $color_guix
echo -ns $guix_glyph 'guix '

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
Expand Down Expand Up @@ -1136,6 +1147,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
__bobthefish_prompt_aws_vault_profile

# Virtual environments
__bobthefish_prompt_guix
__bobthefish_prompt_nix
__bobthefish_prompt_desk
__bobthefish_prompt_rubies
Expand Down

0 comments on commit f74cf8a

Please sign in to comment.