From da7e2f1b49b66073528e861a0983e198d90236f6 Mon Sep 17 00:00:00 2001 From: "Sven A. Schmidt" Date: Wed, 1 Jun 2016 14:48:57 +0100 Subject: [PATCH 1/5] Disabled datetime --- fish_right_prompt.fish | 1 - 1 file changed, 1 deletion(-) diff --git a/fish_right_prompt.fish b/fish_right_prompt.fish index f3d8a7e..7ed7128 100644 --- a/fish_right_prompt.fish +++ b/fish_right_prompt.fish @@ -41,6 +41,5 @@ function fish_right_prompt -d 'bobthefish is all about the right prompt' set_color $fish_color_autosuggestion __bobthefish_cmd_duration - __bobthefish_timestamp set_color normal end From 43af67f68a77cfaae00b56eb6616fd5ebfb17286 Mon Sep 17 00:00:00 2001 From: "Sven A. Schmidt" Date: Wed, 1 Jun 2016 14:50:14 +0100 Subject: [PATCH 2/5] Added segment to display DOCKER_MACHINE_NAME (indicating which docker daemon we're talking to) --- fish_prompt.fish | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fish_prompt.fish b/fish_prompt.fish index 786d6a7..1902a82 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -292,6 +292,14 @@ function __bobthefish_prompt_vagrant_vmware -S -d 'Display VMWare Vagrant status set_color normal end +function __bobthefish_prompt_docker -S + if set -q DOCKER_MACHINE_NAME + __bobthefish_start_segment $__bobthefish_vagrant fff --bold + echo -ns $DOCKER_MACHINE_NAME ' ' + end + set_color normal +end + function __bobthefish_prompt_status -S -a last_status -d 'Display symbols for a non zero exit status, root and background jobs' set -l nonzero set -l superuser @@ -699,6 +707,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' __bobthefish_prompt_status $last_status __bobthefish_prompt_vi __bobthefish_prompt_vagrant + __bobthefish_prompt_docker __bobthefish_prompt_user __bobthefish_prompt_rubies __bobthefish_prompt_virtualfish From d730526c0719b9a54df3071ec58dba4fe63dab1b Mon Sep 17 00:00:00 2001 From: "Sven A. Schmidt" Date: Tue, 7 Jun 2016 08:31:34 +0100 Subject: [PATCH 3/5] Added settings variables to allow date and docker display to be made conditional --- README.md | 2 ++ fish_prompt.fish | 7 +++---- fish_right_prompt.fish | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2cb46a9..4d0d21d 100644 --- a/README.md +++ b/README.md @@ -68,12 +68,14 @@ set -g theme_display_git_untracked no set -g theme_display_git_ahead_verbose yes set -g theme_git_worktree_support yes set -g theme_display_vagrant yes +set -g theme_display_docker_machine no set -g theme_display_hg yes set -g theme_display_virtualenv no set -g theme_display_ruby no set -g theme_display_user yes set -g theme_display_vi yes set -g theme_display_vi_hide_mode default +set -g theme_display_date no set -g theme_title_display_process yes set -g theme_title_display_path no set -g theme_title_use_abbreviated_path no diff --git a/fish_prompt.fish b/fish_prompt.fish index 1902a82..d71248e 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -293,10 +293,9 @@ function __bobthefish_prompt_vagrant_vmware -S -d 'Display VMWare Vagrant status end function __bobthefish_prompt_docker -S - if set -q DOCKER_MACHINE_NAME - __bobthefish_start_segment $__bobthefish_vagrant fff --bold - echo -ns $DOCKER_MACHINE_NAME ' ' - end + [ "$theme_display_docker_machine" = 'no' -o -z "$DOCKER_MACHINE_NAME" ]; and return + __bobthefish_start_segment $__bobthefish_vagrant fff --bold + echo -ns $DOCKER_MACHINE_NAME ' ' set_color normal end diff --git a/fish_right_prompt.fish b/fish_right_prompt.fish index 7ed7128..2f312b9 100644 --- a/fish_right_prompt.fish +++ b/fish_right_prompt.fish @@ -25,6 +25,7 @@ function __bobthefish_cmd_duration -S -d 'Show command duration' end function __bobthefish_timestamp -S -d 'Show the current timestamp' + [ "$theme_display_date" = "no" ]; and return set -q theme_date_format or set -l theme_date_format "+%c" @@ -41,5 +42,6 @@ function fish_right_prompt -d 'bobthefish is all about the right prompt' set_color $fish_color_autosuggestion __bobthefish_cmd_duration + __bobthefish_timestamp set_color normal end From 77977f882f3d6b79ce8cef9a4ee59581c73ffea1 Mon Sep 17 00:00:00 2001 From: "Sven A. Schmidt" Date: Wed, 8 Jun 2016 08:33:41 +0100 Subject: [PATCH 4/5] Added `-d` to function --- fish_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index d71248e..ce61572 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -292,7 +292,7 @@ function __bobthefish_prompt_vagrant_vmware -S -d 'Display VMWare Vagrant status set_color normal end -function __bobthefish_prompt_docker -S +function __bobthefish_prompt_docker -S -d 'Show docker machine name' [ "$theme_display_docker_machine" = 'no' -o -z "$DOCKER_MACHINE_NAME" ]; and return __bobthefish_start_segment $__bobthefish_vagrant fff --bold echo -ns $DOCKER_MACHINE_NAME ' ' From 32cfd831573d6171de2397d1a472d3b60d1f60b8 Mon Sep 17 00:00:00 2001 From: "Sven A. Schmidt" Date: Wed, 8 Jun 2016 08:35:52 +0100 Subject: [PATCH 5/5] Hide `$__bobthefish_left_arrow_glyph` when `$theme_display_date = "no"` --- fish_right_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish_right_prompt.fish b/fish_right_prompt.fish index 2f312b9..f3ef14b 100644 --- a/fish_right_prompt.fish +++ b/fish_right_prompt.fish @@ -21,7 +21,6 @@ function __bobthefish_cmd_duration -S -d 'Show command duration' set_color $fish_color_normal set_color $fish_color_autosuggestion - echo -n $__bobthefish_left_arrow_glyph end function __bobthefish_timestamp -S -d 'Show the current timestamp' @@ -29,6 +28,7 @@ function __bobthefish_timestamp -S -d 'Show the current timestamp' set -q theme_date_format or set -l theme_date_format "+%c" + echo -n $__bobthefish_left_arrow_glyph echo -n ' ' date $theme_date_format end