]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/themes/gnzh.zsh-theme
initial
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / themes / gnzh.zsh-theme
1 # Based on bira theme
2
3 setopt prompt_subst
4
5 () {
6
7 local PR_USER PR_USER_OP PR_PROMPT PR_HOST
8
9 # Check the UID
10 if [[ $UID -ne 0 ]]; then # normal user
11   PR_USER='%F{green}%n%f'
12   PR_USER_OP='%F{green}%#%f'
13   PR_PROMPT='%f➤ %f'
14 else # root
15   PR_USER='%F{red}%n%f'
16   PR_USER_OP='%F{red}%#%f'
17   PR_PROMPT='%F{red}➤ %f'
18 fi
19
20 # Check if we are on SSH or not
21 if [[ -n "$SSH_CLIENT"  ||  -n "$SSH2_CLIENT" ]]; then
22   PR_HOST='%F{red}%M%f' # SSH
23 else
24   PR_HOST='%F{green}%M%f' # no SSH
25 fi
26
27
28 local return_code="%(?..%F{red}%? ↵%f)"
29
30 local user_host="${PR_USER}%F{cyan}@${PR_HOST}"
31 local current_dir="%B%F{blue}%~%f%b"
32 local git_branch='$(git_prompt_info)'
33
34 PROMPT="╭─${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch}
35 ╰─$PR_PROMPT "
36 RPROMPT="${return_code}"
37
38 ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}‹"
39 ZSH_THEME_GIT_PROMPT_SUFFIX="› %f"
40 ZSH_THEME_RUBY_PROMPT_PREFIX="%F{red}‹"
41 ZSH_THEME_RUBY_PROMPT_SUFFIX="›%f"
42
43 }