From 704dfec4a151169187fb24108413fe7dc43a33eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 5 Jun 2017 07:22:17 +0200 Subject: Conditionally integrate annoyme --- zshrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'zshrc') diff --git a/zshrc b/zshrc index 6f4944e..150d286 100644 --- a/zshrc +++ b/zshrc @@ -36,9 +36,15 @@ bindkey "^[[3~" delete-char bindkey "^[3;5~" delete-char # PROMPT ####################################################### -if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi +annoyme_check() { + which annoyme >/dev/null 2>&1 && ls ~/.annoyme/*.pid 2>/dev/null >&2 && \ + echo "%{$fg_bold[red]%}!" +} + +[ $UID -eq 0 ] && NCOLOR="red" || NCOLOR="green" PROMPT="%(?..%{$fg_bold[yellow]%}EXIT: %? -)%{$fg_bold[$NCOLOR]%}%n@%m:%{$fg_bold[blue]%}%1~%{$fg_bold[$NCOLOR]%}%(!.#.$)%{$reset_color%} " +)\$(annoyme_check)%{$fg_bold[$NCOLOR]%}%n@%m:%{$fg_bold[blue]%}%1~%{$fg_bold[$NCOLOR]%}%(!.#.$)%{$reset_color%} " +unset NCOLOR if [ -e ~/.local/git-prompt.sh ]; then source ~/.local/git-prompt.sh -- cgit v1.2.3