home | blog | art | now | git gpg | email | rss

dotfiles

My personal dotfiles
git clone git://pollux.codes/git/dotfiles.git
Log | Files | Refs | LICENSE

99_prompt.zsh (287B)


      1 
      2 eval "$(oh-my-posh init zsh --config ~/.posh-pollux-theme.json)"
      3 
      4 visiblelen() {
      5 	local zero='%([BSUbfksu]|([FK]|){*})'
      6 	echo ${#${(S%%)1//$~zero/}}
      7 }
      8 
      9 center() {
     10 	TEXT=$(print -P "$1")
     11 	LENGTH=$(visiblelen "$1")
     12 	printf "%$(( ( $(tput cols) - $LENGTH ) / 2 + ${#TEXT} ))s\n" "$TEXT"
     13 }