aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason2019-10-10 14:33:19 -0600
committerjason2019-10-10 14:33:19 -0600
commit39af88f3386c3b2570cc69bf2bf38c07219a52fa (patch)
treee4bb0595ef934e707e6b003d82e9d3360af9b511
parentd2dbb08a34958ad9d5be183dea1d7c110b8ce40d (diff)
downloaddotfiles-39af88f3386c3b2570cc69bf2bf38c07219a52fa.tar.gz
dotfiles-39af88f3386c3b2570cc69bf2bf38c07219a52fa.zip
fix docker machine status, better git status
-rw-r--r--zsh/.zsh/custom/plugins/docker-machine/docker-machine-prompt.bash18
-rw-r--r--zsh/.zshrc9
2 files changed, 15 insertions, 12 deletions
diff --git a/zsh/.zsh/custom/plugins/docker-machine/docker-machine-prompt.bash b/zsh/.zsh/custom/plugins/docker-machine/docker-machine-prompt.bash
index 0a6e43a..d7815e5 100644
--- a/zsh/.zsh/custom/plugins/docker-machine/docker-machine-prompt.bash
+++ b/zsh/.zsh/custom/plugins/docker-machine/docker-machine-prompt.bash
@@ -20,28 +20,28 @@
20__docker_machine_ps1 () { 20__docker_machine_ps1 () {
21 local format=${1:- [%s]} 21 local format=${1:- [%s]}
22 if test ${DOCKER_MACHINE_NAME}; then 22 if test ${DOCKER_MACHINE_NAME}; then
23 local status 23 local machine_status=''
24 if test ${DOCKER_MACHINE_PS1_SHOWSTATUS:-false} = true; then 24 if test ${DOCKER_MACHINE_PS1_SHOWSTATUS:-false} = true; then
25 status=$(docker-machine status ${DOCKER_MACHINE_NAME}) 25 machine_status=$(docker-machine status ${DOCKER_MACHINE_NAME})
26 case ${status} in 26 case ${machine_status} in
27 Running) 27 Running)
28 status=' R' 28 machine_status=' R'
29 ;; 29 ;;
30 Stopping) 30 Stopping)
31 status=' R->S' 31 machine_status=' R->S'
32 ;; 32 ;;
33 Starting) 33 Starting)
34 status=' S->R' 34 machine_status=' S->R'
35 ;; 35 ;;
36 Error|Timeout) 36 Error|Timeout)
37 status=' E' 37 machine_status=' E'
38 ;; 38 ;;
39 *) 39 *)
40 # Just consider everything elase as 'stopped' 40 # Just consider everything elase as 'stopped'
41 status=' S' 41 machine_status=' S'
42 ;; 42 ;;
43 esac 43 esac
44 fi 44 fi
45 printf -- "${format}" "${DOCKER_MACHINE_NAME}${status}" 45 printf -- "${format}" "${DOCKER_MACHINE_NAME}${machine_status}"
46 fi 46 fi
47} 47}
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 2aa0ce4..2cc4ef1 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -48,7 +48,7 @@ ZSH_CUSTOM=$HOME/.zsh/custom
48# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 48# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
49# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 49# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
50# Example format: plugins=(rails git textmate ruby lighthouse) 50# Example format: plugins=(rails git textmate ruby lighthouse)
51plugins=(git git-extras docker docker-compose docker-machine gpg-agent pep8 pip pyenv pylint python web-search wd) 51plugins=(git git-extras git-prompt docker docker-compose docker-machine gpg-agent pep8 pip pyenv pylint python web-search wd)
52 52
53ZSH=~/.oh-my-zsh 53ZSH=~/.oh-my-zsh
54 54
@@ -136,8 +136,11 @@ show_virtual_env() {
136 fi 136 fi
137} 137}
138 138
139#PS1='$(show_virtual_env)'$PS1 139PROMPT='[%{$fg_bold[white]%}%n%{$reset_color%}@%{$fg_bold[red]%}%m%{$reset_color%} %{$fg[cyan]%}%1~%{$reset_color%}$(__docker_machine_ps1)]%# '
140PS1="$PS1 $(__docker_machine_ps1)" 140
141# Configure git prompt colors
142# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git-prompt/git-prompt.plugin.zsh#L76
143ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[cyan]%}%{✚%G%}" # default is blue and hard to see
141 144
142[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 145[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
143 146