From 63bbc2e2ea8c0a5a26571b95f6b61e6f6a39b0ab Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 6 Jan 2012 16:02:15 +0100 Subject: ZSH: Change prompt again Change the prompt and divide into extra files. --- .zsh/functions/prompt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .zsh/functions/prompt (limited to '.zsh/functions/prompt') diff --git a/.zsh/functions/prompt b/.zsh/functions/prompt new file mode 100644 index 0000000..af15976 --- /dev/null +++ b/.zsh/functions/prompt @@ -0,0 +1,16 @@ +# -*- mode: shell-script -*- + +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>%s ' \ + "%{${fg[magenta]}%}" $hostname "%{${fg[default]}%}" \ + "%{${fg[green]}%}" "%~" "%{${fg[default]}%}" \ + "%(?.%{${fg[green]}%}.%{${fg[red]}%})%B" "%b%{${fg[default]}%}" -- cgit v1.2.3-54-g00ecf