summaryrefslogtreecommitdiff
path: root/.zsh/functions/prompt_necoro_setup
blob: 16d36547df138cd0fb709649ba92647d1c147edd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# gentoo prompt theme

prompt_necoro_help () {
  cat <<'EOF'
This prompt is color-scheme-able.  You can invoke it thus:

  prompt necoro [<promptcolor> [<usercolor> [<rootcolor>]]]

EOF
}

prompt_necoro_setup () {
  prompt_necoro_prompt=${1:-'blue'}
  prompt_necoro_user=${2:-'green'}
  prompt_necoro_root=${3:-'red'}

  if [ "$USER" = 'root' ]
  then
    base_prompt="%B%F{$prompt_necoro_root}%m%k "
  else
    base_prompt="%B%F{$prompt_necoro_user}%n@%m%k "
  fi
  post_prompt="%b%f%k"

  #setopt noxtrace localoptions

  path_prompt="%B%F{$prompt_necoro_prompt}%1~"
  PS1="$base_prompt$path_prompt %# $post_prompt"
  PS2="$base_prompt$path_prompt %_> $post_prompt"
  PS3="$base_prompt$path_prompt ?# $post_prompt"
}

prompt_necoro_setup "$@"