From e53667c7ee8d6fde268dfd48b308f0e38f729013 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 21 Aug 2014 00:14:54 +0200 Subject: Restore zsh config --- zsh/.zsh/functions/prompt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 zsh/.zsh/functions/prompt (limited to 'zsh/.zsh/functions/prompt') diff --git a/zsh/.zsh/functions/prompt b/zsh/.zsh/functions/prompt new file mode 100644 index 0000000..6fe927b --- /dev/null +++ b/zsh/.zsh/functions/prompt @@ -0,0 +1,15 @@ +# -*- mode: shell-script; eval: (git-auto-commit-mode 1) -*- + +local pac_cnt=$(get_cnt updates) +local aur_cnt=$(get_cnt aur) +local hostname=$(hostname | cut -d . -f 1) + +if [ $pac_cnt -gt 0 -o $aur_cnt -gt 0 ]; then + printf "%s%d%s/%s%d%s:" \ + "%{${fg[cyan]}%}" $pac_cnt "%{${fg[default]}%}" \ + "%{${fg[cyan]}%}" $aur_cnt "%{${fg[default]}%}" +fi + +printf '%s%s%s:%s%s%s%s ' \ + "%{${fg[magenta]}%}" $hostname "%{${fg[default]}%}" \ + "%(?.%{${fg[green]}%}.%{${fg[red]}%})" "%~" "%{${fg[default]}%}" -- cgit v1.2.3-54-g00ecf