summaryrefslogtreecommitdiffstats
path: root/.zsh/functions/prompt
blob: af15976e1713d18a05841cf3db3f80249c9f2cc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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]}%}"