From 341a9e94fee11a145332e9dfb13f384e00a8dda7 Mon Sep 17 00:00:00 2001 From: Roman Allenstein Date: Tue, 21 Feb 2017 16:22:27 +0100 Subject: [PATCH] =?UTF-8?q?added=20vagrant=20machine=20status=20to=20statu?= =?UTF-8?q?s=20prompt.=20show=20=E2=96=B6=20and=20=E2=97=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/agnoster.zsh-theme | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 07546fd34..dc909e353 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -202,6 +202,7 @@ prompt_virtualenv() { # - was there an error # - am I root # - are there background jobs? +# - is there a vagrant box - if yes, is it running? prompt_status() { local symbols symbols=() @@ -209,6 +210,14 @@ prompt_status() { [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" + if [[ -d ./.vagrant/machines ]]; then + if [[ $(VBoxManage list runningvms | grep -c $(/bin/cat .vagrant/machines/*/*/id)) -gt 0 ]]; then + symbols+="%{%F{green}%}▶" + else + symbols+="%{%F{red}%}◾" + fi + fi + [[ -n "$symbols" ]] && prompt_segment black default "$symbols" }