mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
added vagrant machine status to status prompt. show ▶ and ◾
This commit is contained in:
parent
98d8d3429f
commit
341a9e94fe
1 changed files with 9 additions and 0 deletions
|
|
@ -202,6 +202,7 @@ prompt_virtualenv() {
|
||||||
# - was there an error
|
# - was there an error
|
||||||
# - am I root
|
# - am I root
|
||||||
# - are there background jobs?
|
# - are there background jobs?
|
||||||
|
# - is there a vagrant box - if yes, is it running?
|
||||||
prompt_status() {
|
prompt_status() {
|
||||||
local symbols
|
local symbols
|
||||||
symbols=()
|
symbols=()
|
||||||
|
|
@ -209,6 +210,14 @@ prompt_status() {
|
||||||
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
|
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
|
||||||
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙"
|
[[ $(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"
|
[[ -n "$symbols" ]] && prompt_segment black default "$symbols"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue