From 3c95feb0bdefc22a9a37529dc6f48b31a18d3a20 Mon Sep 17 00:00:00 2001 From: sabricot Date: Sun, 6 Mar 2016 18:25:17 +0100 Subject: [PATCH 1/2] Add a docker machine segment --- README.md | 1 + functions/icons.zsh | 3 +++ powerlevel9k.zsh-theme | 11 ++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d46a8dea..59885529 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ The segments that are currently available are: * **AWS Segments:** * [`aws`](#aws) - The current AWS profile, if active. * `aws_eb_env` - The current Elastic Beanstalk Environment. +* `docker_machine` - The current Docker Machine **Other:** * [`custom_command`](#custom_command) - Create a custom segment to display the diff --git a/functions/icons.zsh b/functions/icons.zsh index e7dc3bfa..e40d6060 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -51,6 +51,7 @@ case $POWERLEVEL9K_MODE in LOAD_ICON $'\UE190 ' #  SWAP_ICON $'\UE87D' #  RAM_ICON $'\UE1E2 ' #  + SERVER_ICON $'\UE895' #  VCS_UNTRACKED_ICON $'\UE16C' #  VCS_UNSTAGED_ICON $'\UE17C' #  VCS_STAGED_ICON $'\UE168' #  @@ -105,6 +106,7 @@ case $POWERLEVEL9K_MODE in LOAD_ICON $'\UF080 ' #  SWAP_ICON $'\UF0E4' #  RAM_ICON $'\UF0E4' #  + SERVER_ICON $'\UF296' #  VCS_UNTRACKED_ICON $'\UF059' #  VCS_UNSTAGED_ICON $'\UF06A' #  VCS_STAGED_ICON $'\UF055' #  @@ -155,6 +157,7 @@ case $POWERLEVEL9K_MODE in LOAD_ICON 'L' SWAP_ICON 'SWP' RAM_ICON 'RAM' + SERVER_ICON '' VCS_UNTRACKED_ICON '?' VCS_UNSTAGED_ICON $'\u25CF' # ● VCS_STAGED_ICON $'\u271A' # ✚ diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 2ef4fe3c..64ad1391 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -463,6 +463,15 @@ prompt_dir() { fi } +# Docker machine +prompt_docker_machine() { + local docker_machine="$DOCKER_MACHINE_NAME" + + if [[ -n "$docker_machine" ]]; then + "$1_prompt_segment" "$0" "$2" "magenta" "$DEFAULT_COLOR" "$docker_machine" 'SERVER_ICON' + fi +} + # GO prompt prompt_go_version() { local go_version @@ -572,7 +581,7 @@ prompt_nodeenv() { local nodeenv_path="$NODE_VIRTUAL_ENV" if [[ -n "$nodeenv_path" && "$NODE_VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then local info="$(node -v)[$(basename "$nodeenv_path")]" - "$1_prompt_segment" "$0" "$2" "black" "green" "$info" 'NODE_ICON' + "$1_prompt_segment" "$0" "$2" "black" "green" "$info" 'NODE_ICON' fi } From 8feee5d4ccfe1486ad8b15e8e234f68d1ceb6997 Mon Sep 17 00:00:00 2001 From: sabricot Date: Sun, 6 Mar 2016 18:32:07 +0100 Subject: [PATCH 2/2] Fix typo about docker in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59885529..f5a689cf 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ The segments that are currently available are: * **AWS Segments:** * [`aws`](#aws) - The current AWS profile, if active. * `aws_eb_env` - The current Elastic Beanstalk Environment. -* `docker_machine` - The current Docker Machine +* `docker_machine` - The current Docker Machine. **Other:** * [`custom_command`](#custom_command) - Create a custom segment to display the