legacy-dotfiles/.zsh/functions/prompt

20 lines
629 B
Bash

# -*- 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)
printf "%s" \
"%B%(?.%{${fg[green]}%}^_^.%{${fg[red]}%}T_T)%b%{${fg[default]}%}"
line 4 15
printf "%s" "$(date +%Y%m%d%H.%M)"
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[default]}%}"